VirtualBox

Changeset 90292 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Jul 22, 2021 3:07:05 PM (4 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:10067: A bit more suitable colors for light/dark themed UINotificationObjectItem.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/notificationcenter/UINotificationObjectItem.cpp

    r90290 r90292  
    137137
    138138    /* Gather suitable colors: */
    139     QColor color1 = pal.color(fActive ? QPalette::Active : QPalette::Inactive, QPalette::Window).lighter(110);
    140     QColor color2 = pal.color(fActive ? QPalette::Active : QPalette::Inactive, QPalette::Window).lighter(105);
     139    QColor color = pal.color(fActive ? QPalette::Active : QPalette::Inactive, QPalette::Window);
     140    QColor color1;
     141    QColor color2;
     142    if (color.black() > 128)
     143    {
     144        color1 = color.lighter(110);
     145        color2 = color.lighter(105);
     146    }
     147    else
     148    {
     149        color1 = color.darker(105);
     150        color2 = color.darker(110);
     151    }
    141152    /* Prepare background gradient: */
    142153    QLinearGradient grad(QPointF(0, 0), QPointF(width(), height()));
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