Changeset 102508 in vbox
- Timestamp:
- Dec 6, 2023 3:51:14 PM (12 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/globals/UICommon.cpp
r102503 r102508 1009 1009 * moreover these colors are influenced by window background blending, 1010 1010 * making Qt default colors incredibly inconsistent with native macOS apps. */ 1011 QPalette pal = qApp->palette(); 1012 if (isInDarkMode()) 1013 { 1014 pal.setColor(QPalette::Active, QPalette::Window, QColor("#252328")); 1015 pal.setColor(QPalette::Inactive, QPalette::Window, QColor("#2A2630")); 1016 } 1017 else 1018 { 1019 pal.setColor(QPalette::Active, QPalette::Window, QColor("#E1DEE4")); 1020 pal.setColor(QPalette::Inactive, QPalette::Window, QColor("#EEE8E9")); 1021 } 1022 qApp->setPalette(pal); 1011 1012 /* Redefine colors for known OS types: */ 1013 enum ColorSlot 1014 { 1015 ColorSlot_DarkActive, 1016 ColorSlot_DarkInactive, 1017 ColorSlot_LightActive, 1018 ColorSlot_LightInactive, 1019 }; 1020 QMap<ColorSlot, QColor> colors; 1021 switch (osRelease()) 1022 { 1023 case MacOSXRelease_BigSur: 1024 { 1025 colors[ColorSlot_DarkActive] = QColor("#282628"); 1026 colors[ColorSlot_DarkInactive] = QColor("#2E292E"); 1027 colors[ColorSlot_LightActive] = QColor("#E7E2E3"); 1028 colors[ColorSlot_LightInactive] = QColor("#EEE9EA"); 1029 break; 1030 } 1031 case MacOSXRelease_Monterey: 1032 { 1033 colors[ColorSlot_DarkActive] = QColor("#252328"); 1034 colors[ColorSlot_DarkInactive] = QColor("#2A2630"); 1035 colors[ColorSlot_LightActive] = QColor("#E1DEE4"); 1036 colors[ColorSlot_LightInactive] = QColor("#EEE8E9"); 1037 break; 1038 } 1039 case MacOSXRelease_Ventura: 1040 { 1041 colors[ColorSlot_DarkActive] = QColor("#322827"); 1042 colors[ColorSlot_DarkInactive] = QColor("#332A28"); 1043 colors[ColorSlot_LightActive] = QColor("#E5E0DF"); 1044 colors[ColorSlot_LightInactive] = QColor("#ECE7E5"); 1045 break; 1046 } 1047 default: 1048 break; 1049 } 1050 1051 /* Do we have redefined colors? */ 1052 if (!colors.isEmpty()) 1053 { 1054 QPalette pal = qApp->palette(); 1055 if (isInDarkMode()) 1056 { 1057 pal.setColor(QPalette::Active, QPalette::Window, colors.value(ColorSlot_DarkActive)); 1058 pal.setColor(QPalette::Inactive, QPalette::Window, colors.value(ColorSlot_DarkInactive)); 1059 } 1060 else 1061 { 1062 pal.setColor(QPalette::Active, QPalette::Window, colors.value(ColorSlot_LightActive)); 1063 pal.setColor(QPalette::Inactive, QPalette::Window, colors.value(ColorSlot_LightInactive)); 1064 } 1065 qApp->setPalette(pal); 1066 } 1023 1067 1024 1068 #elif defined(VBOX_WS_WIN)
Note:
See TracChangeset
for help on using the changeset viewer.