Changeset 9779 in vbox
- Timestamp:
- Jun 17, 2008 4:02:42 PM (17 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox4
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox4/include/QILabel_p.h
r9729 r9779 90 90 void mouseMoveEvent (QMouseEvent *aEvent); 91 91 void contextMenuEvent (QContextMenuEvent *aEvent); 92 void focusInEvent (QFocusEvent *aEvent); 93 void focusOutEvent (QFocusEvent *aEvent); 92 94 93 95 protected slots: -
trunk/src/VBox/Frontends/VirtualBox4/src/QILabel.cpp
r9392 r9779 258 258 /* The label should be able to get the focus */ 259 259 setFocusPolicy (Qt::StrongFocus); 260 /* Change the appearance in focus state a little bit */ 260 /* Change the appearance in focus state a little bit. 261 * Note: Unfortunately QLabel, precisely the text of a QLabel isn't 262 * styleable. The trolls have forgotten the simplest case ... So this 263 * is done by changing the current used palette in the In/Out-focus 264 * events below. */ 261 265 setStyleSheet (QString("QLabel::focus {\ 262 color: palette(highlighted-text);\263 266 background-color: palette(highlight);\ 264 267 }")); … … 327 330 QLabel::contextMenuEvent (aEvent); 328 331 } 332 333 void QILabelPrivate::focusInEvent (QFocusEvent * /* aEvent */) 334 { 335 if (mFullSizeSeclection) 336 { 337 /* Set the text color to the current used highlight text color. */ 338 QPalette pal = qApp->palette(); 339 pal.setBrush (QPalette::WindowText, pal.brush (QPalette::HighlightedText)); 340 setPalette (pal); 341 } 342 } 343 344 void QILabelPrivate::focusOutEvent (QFocusEvent *aEvent) 345 { 346 /* Reset to the default palette */ 347 if (mFullSizeSeclection && 348 aEvent->reason() != Qt::PopupFocusReason) /* For right mouse click */ 349 setPalette (qApp->palette()); 350 } 351 329 352 330 353 void QILabelPrivate::copy()
Note:
See TracChangeset
for help on using the changeset viewer.