Fix Combo widget background color only for Windows
@@ -451,10 +451,6 @@ public class PropsUi extends Props {
}
public void setLook(Control widget) {
- if (widget instanceof Combo) {
- return; // Just keep the default
- }
-
setLook(widget, WIDGET_STYLE_DEFAULT);
if (widget instanceof Composite) {
@@ -474,6 +470,8 @@ public class PropsUi extends Props {
case WIDGET_STYLE_DEFAULT:
background = gui.getColorWhite();
foreground = gui.getColorBlack();
+ font = null;
+
if (control instanceof Group && OS.contains("mac")) {
control.addPaintListener(
paintEvent -> {
@@ -484,13 +482,12 @@ public class PropsUi extends Props {
});
}
else if (control instanceof Combo) {
- if (PropsUi.instance.isDarkMode()) {
- background = GuiResource.getInstance().getColorLightGray();
+ if (Const.isWindows() && isDarkMode()) {
+ background = gui.getColorBackground();
} else {
- background = GuiResource.getInstance().getColorDemoGray();
+ return; // Just keep the default
}
}
- font = null;
break;
case WIDGET_STYLE_FIXED:
foreground = gui.getColorBlack();
@@ -514,19 +511,19 @@ public class PropsUi extends Props {
break;
case WIDGET_STYLE_TOOLBAR:
foreground = gui.getColorBlack();
- if (PropsUi.instance.isDarkMode()) {
- background = GuiResource.getInstance().getColorLightGray();
+ if (isDarkMode()) {
+ background = gui.getColorLightGray();
} else {
- background = GuiResource.getInstance().getColorDemoGray();
+ background = gui.getColorDemoGray();
}
break;
case WIDGET_STYLE_TAB:
- background = GuiResource.getInstance().getColorWhite();
- foreground = GuiResource.getInstance().getColorBlack();
+ background = gui.getColorWhite();
+ foreground = gui.getColorBlack();
CTabFolder tabFolder = (CTabFolder) control;
tabFolder.setBorderVisible(true);
// need to make a copy of the tab selection background color to get around bug
- Color c = GuiResource.getInstance().getColorTab();
+ Color c = gui.getColorTab();
Color tabColor = new Color(c.getDevice(), c.getRed(), c.getGreen(), c.getBlue());
tabFolder.setSelectionBackground(tabColor);
break;
