void createHandle() { super.createHandle(); state |= THEME_BACKGROUND; if (OS.COMCTL32_MAJOR < 6) { layout = new TextLayout(display); if (!OS.IsWinCE && OS.WIN32_VERSION >= OS.VERSION(4, 10)) { linkColor = Color.win32_new(display, OS.GetSysColor(OS.COLOR_HOTLIGHT)); } else { linkColor = new Color(display, LINK_FOREGROUND); } disabledColor = Color.win32_new(display, OS.GetSysColor(OS.COLOR_GRAYTEXT)); offsets = new Point[0]; ids = new String[0]; mnemonics = new int[0]; selection = new Point(-1, -1); focusIndex = mouseDownIndex = -1; } }
public static Color getConnectionColor(DBPConnectionConfiguration connectionInfo) { String rgbString = connectionInfo.getConnectionColor(); if (CommonUtils.isEmpty(rgbString)) { rgbString = connectionInfo.getConnectionType().getColor(); } if (CommonUtils.isEmpty(rgbString)) { return null; } Color connectionColor = DBeaverUI.getSharedTextColors().getColor(StringConverter.asRGB(rgbString)); if (connectionColor.getBlue() == 255 && connectionColor.getRed() == 255 && connectionColor.getGreen() == 255) { // For white color return just null to avoid explicit color set. // It is important for dark themes return null; } return connectionColor; }
void releaseWidget() { super.releaseWidget(); if (layout != null) layout.dispose(); layout = null; if (linkColor != null) linkColor.dispose(); linkColor = null; disabledColor = null; offsets = null; ids = null; mnemonics = null; text = null; }
public void setBackground(Color color) { super.setBackground(color); // Are these settings the same as before? if (backgroundImage == null && gradientColors == null && gradientPercents == null) { if (color == null) { if (background == null) return; } else { if (color.equals(background)) return; } } background = color; backgroundImage = null; gradientColors = null; gradientPercents = null; redraw(); }