Skip to content

Commit 9baef58

Browse files
committed
[GTK] Implement Display.getHighContrast
Gtk ships with "HighContrast" and "HighContrastInverse" and Mate desktop ships "ContrastHigh*" theme. If the gtk theme is any of these say it's "high contrast" theme.
1 parent 007426f commit 9baef58

File tree

1 file changed

+4
-0
lines changed
  • bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets

1 file changed

+4
-0
lines changed

bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Display.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2519,6 +2519,10 @@ public Control getFocusControl () {
25192519
*/
25202520
public boolean getHighContrast () {
25212521
checkDevice ();
2522+
String gtkThemeName= OS.getThemeName();
2523+
if (gtkThemeName.contains("HighContrast") || gtkThemeName.contains("ContrastHigh")) {
2524+
return true;
2525+
}
25222526
return false;
25232527
}
25242528

0 commit comments

Comments
 (0)