Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLeo Ufimtsev2018-04-25 17:50:48 +0000
committerLeo Ufimtsev2018-04-27 11:55:27 +0000
commit886e6c5bac16f14c66405e5d72874a39c632835e (patch)
treed94dcfb2d557617001a0b1c542b16602c07d8235 /bundles/org.eclipse.swt/Eclipse SWT PI/gtk
parent9a92da14a27e579409c00ff3eefd197eac4209da (diff)
downloadeclipse.platform.swt-886e6c5bac16f14c66405e5d72874a39c632835e.tar.gz
eclipse.platform.swt-886e6c5bac16f14c66405e5d72874a39c632835e.tar.xz
eclipse.platform.swt-886e6c5bac16f14c66405e5d72874a39c632835e.zip
Bug 527729 - Apply Themefixes unless flag specified.
After further investigation, the style fixes seemed to be needed for Ubutu's dark theme to function properly. Solution: - (as before) Apply Functional fixes (like keyboard navigation) at all times. - Apply theme fixes for all themes, but permit them to be turned off if the following Java vm arg is specified: -Dorg.eclipse.swt.internal.gtk.noThemingFixes - (as before): Allow custom css to be loaded via: org.eclipse.swt.internal.gtk.cssFile. This should fix Ubuntu's dark theme issue but still allow clients to turn off special theme fixes. Please reply with +1/-1 if you are in favor or against this approach. This patch is fairly trivial, if you have an alternative suggestion, please feel free to share. Bug: https://bugs.eclipse.org/bugs/show_bug.cgi?id=527729 Change-Id: Ib2e419ee29385a9261a3bef754ef92b168d161b4 Signed-off-by: Leo Ufimtsev <lufimtse@redhat.com>
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT PI/gtk')
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/swt_adwaita_gtk_pre320.css12
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/swt_functional_gtk_320.css (renamed from bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/swt_common_gtk_320.css)0
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/swt_functional_gtk_pre320.css (renamed from bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/swt_common_gtk_pre320.css)1
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/swt_theming_fixes_gtk_320.css (renamed from bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/swt_adwaita_gtk_320.css)0
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/swt_theming_fixes_gtk_pre320.css15
6 files changed, 18 insertions, 12 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java
index 48160eb14c..7b7685e406 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java
@@ -4230,6 +4230,8 @@ public static final native int strcmp (long /*int*/ s1, byte [] s2);
* Adwaita
* Adwaita-Dark
* Ambiance (Ubuntu).
+ *
+ * See also: Device.overrideThemeValues();
*/
public static final String getThemeName() {
byte[] themeNameBytes = getThemeNameBytes();
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/swt_adwaita_gtk_pre320.css b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/swt_adwaita_gtk_pre320.css
deleted file mode 100644
index 84f46e3ef9..0000000000
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/swt_adwaita_gtk_pre320.css
+++ /dev/null
@@ -1,12 +0,0 @@
-GtkToolbar {
- padding-top: 2px;
- padding-bottom: 2px;
-}
-
-GtkToolbar GtkButton {
- padding: 2px 4px 2px 4px;
-}
-
-GtkToolbar GtkMenuButton {
- padding: 1px 0px 1px 0px;
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/swt_common_gtk_320.css b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/swt_functional_gtk_320.css
index a74e9fbe4a..a74e9fbe4a 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/swt_common_gtk_320.css
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/swt_functional_gtk_320.css
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/swt_common_gtk_pre320.css b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/swt_functional_gtk_pre320.css
index 6a03f5c66f..4ed146c449 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/swt_common_gtk_pre320.css
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/swt_functional_gtk_pre320.css
@@ -1,3 +1,4 @@
+/* These CSS fixes have 'functinal' impact, no visual impact. E.g allow keyboard navigation in trees etc.. */
.undershoot.top, .undershoot.right, .undershoot.bottom, .undershoot.lef {
background-image: none;
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/swt_adwaita_gtk_320.css b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/swt_theming_fixes_gtk_320.css
index fb0cccb789..fb0cccb789 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/swt_adwaita_gtk_320.css
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/swt_theming_fixes_gtk_320.css
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/swt_theming_fixes_gtk_pre320.css b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/swt_theming_fixes_gtk_pre320.css
new file mode 100644
index 0000000000..4b68e8a08b
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/swt_theming_fixes_gtk_pre320.css
@@ -0,0 +1,15 @@
+/* These have an impact on visual aspects of SWT. Padding etc..
+ There should not be hard-coded color fixes because this can break dark variants of themes.
+ Instead either use OS.setDarkThemePreferred() if your theme has dark version or style manually via api */
+GtkToolbar {
+ padding-top: 2px;
+ padding-bottom: 2px;
+}
+
+GtkToolbar GtkButton {
+ padding: 2px 4px 2px 4px;
+}
+
+GtkToolbar GtkMenuButton {
+ padding: 1px 0px 1px 0px;
+} \ No newline at end of file

Back to the top