VirtualBox

Ignore:
Timestamp:
Nov 19, 2012 10:04:39 AM (12 years ago)
Author:
vboxsync
Message:

FE/Qt: VM group UI: Using more native colors for group item arrow
buttons.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/widgets/graphics/UIGraphicsButton.cpp

    r42799 r43910  
    101101            /* Prepare variables: */
    102102            QPalette pal = palette();
    103             QColor backgroundColor = pal.color(m_fParentSelected ? QPalette::Highlight : QPalette::Window);
    104             QColor buttonColor = pal.color(QPalette::Window);
    105             if (backgroundColor.lightness() > 170)
    106                 buttonColor = buttonColor.darker(160);
    107             else
    108                 buttonColor = buttonColor.darker(99);
     103            QColor buttonColor = pal.color(m_fParentSelected ? QPalette::HighlightedText : QPalette::Mid);
     104#ifdef Q_WS_MAC
     105            /* Mac is using only light standard highlight colors, keeping highlight-text color always black.
     106             * User can choose a darker (non-standard) highlight color but it will be his visibility problem.
     107             * I think using highlight-text color (black) for arrow-buttons is too ugly,
     108             * so the corresponding color will be received from the highlight color: */
     109            if (m_fParentSelected)
     110                buttonColor = pal.color(QPalette::Highlight).darker(150);
     111#endif /* Q_WS_MAC */
    109112
    110113            /* Setup: */
     
    136139            /* Prepare variables: */
    137140            QPalette pal = palette();
    138             QColor backgroundColor = pal.color(m_fParentSelected ? QPalette::Highlight : QPalette::Window);
    139             QColor buttonColor = pal.color(QPalette::Window);
    140             if (backgroundColor.lightness() > 170)
    141                 buttonColor = buttonColor.darker(160);
    142             else
    143                 buttonColor = buttonColor.darker(99);
     141            QColor buttonColor = pal.color(m_fParentSelected ? QPalette::HighlightedText : QPalette::Mid);
     142#ifdef Q_WS_MAC
     143            /* Mac is using only light standard highlight colors, keeping highlight-text color always black.
     144             * User can choose a darker (non-standard) highlight color but it will be his visibility problem.
     145             * I think using highlight-text color (black) for arrow-buttons is too ugly,
     146             * so the corresponding color will be received from the highlight color: */
     147            if (m_fParentSelected)
     148                buttonColor = pal.color(QPalette::Highlight).darker(150);
     149#endif /* Q_WS_MAC */
    144150
    145151            /* Setup: */
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette