Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLeo Ufimtsev2018-04-05 21:31:15 +0000
committerAlexander Kurtakov2018-04-12 12:10:47 +0000
commit99918a7e30af8416e86b7aa0479d938af6445eed (patch)
tree4042168dbce5153094884bc01d9c66b57ff6ee53 /bundles/org.eclipse.swt/Eclipse SWT PI/gtk
parent7e52a8649e85b8be95a9e5e1c8e0455b61186c1d (diff)
downloadeclipse.platform.swt-99918a7e30af8416e86b7aa0479d938af6445eed.tar.gz
eclipse.platform.swt-99918a7e30af8416e86b7aa0479d938af6445eed.tar.xz
eclipse.platform.swt-99918a7e30af8416e86b7aa0479d938af6445eed.zip
Bug 527729 Only load Adwaita theme fixes if system theme is Adwaita.
Currently we apply Adwaita-specific fixes (e.g excessive padding) to all themes. This breaks some non-adwaita themes (e.g Phenix). The fix is to check which system them is used and only load Adwaita fixes for Adwaita theme. One thing to note is that we also load some CSS for functional fixes such as keyboard shortcut bindings. These should still be loaded for all themes. I tested on my Fedora 27, Gtk3.22. - Adwaita/Adwaita-dark look as before. - Ambiance looks ok. Toolbars are a little tall, but ok. - Clear-Phenix looks ok. Toolbars are a little tall, but ok. Tool buttons now seem to have proper size and entry looks ok. Bug: https://bugs.eclipse.org/bugs/show_bug.cgi?id=527729322 Change-Id: I6b932b86d4cdc20003cc8c2fcfbc7f9e67e84fe1 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.java8
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/swt_adwaita_gtk_320.css25
-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_common_gtk_320.css (renamed from bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/swtgtk_320.css)26
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/swt_common_gtk_pre320.css (renamed from bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/swtgtk_pre320.css)13
5 files changed, 45 insertions, 39 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 7cd07e467a..85386b46e6 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
@@ -4194,6 +4194,14 @@ public static final int access (byte [] path, int amode) {
*/
public static final native int strcmp (long /*int*/ s1, byte [] s2);
+/**
+ * Theme name as given by OS.
+ * You can see the exact theme name via Tweak Tools -> Appearance -> Themes.
+ * E.g
+ * Adwaita
+ * Adwaita-Dark
+ * Ambiance (Ubuntu).
+ */
public static final String getThemeName() {
byte[] themeNameBytes = getThemeNameBytes();
String themeName = "unknown";
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_adwaita_gtk_320.css
new file mode 100644
index 0000000000..fb0cccb789
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/swt_adwaita_gtk_320.css
@@ -0,0 +1,25 @@
+toolbar {
+ padding-top: 2px;
+ padding-bottom: 2px;
+}
+
+toolbar button {
+ padding: 2px;
+}
+
+toolbar button.popup {
+ padding: 0px;
+}
+
+toolbar toolbutton button {
+ padding: 0px 0px 0px 0px;
+}
+
+entry {
+ min-height: 26px;
+}
+
+tab {
+ padding-left: 6px;
+ padding-right: 6px;
+} \ No newline at end of file
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
new file mode 100644
index 0000000000..84f46e3ef9
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/swt_adwaita_gtk_pre320.css
@@ -0,0 +1,12 @@
+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/swtgtk_320.css b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/swt_common_gtk_320.css
index df16c902fe..a74e9fbe4a 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/swtgtk_320.css
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/swt_common_gtk_320.css
@@ -1,20 +1,3 @@
-toolbar {
- padding-top: 2px;
- padding-bottom: 2px;
-}
-
-toolbar button {
- padding: 2px;
-}
-
-toolbar button.popup {
- padding: 0px;
-}
-
-toolbar toolbutton button {
- padding: 0px 0px 0px 0px;
-}
-
@binding-set SWTTreeViewBinding {
bind "Left" { "expand-collapse-cursor-row" (0,0,0)};
bind "Right" { "expand-collapse-cursor-row" (0,1,0)};
@@ -27,13 +10,4 @@ treeview {
scrolledwindow undershoot.top, scrolledwindow undershoot.right,
scrolledwindow undershoot.bottom, scrolledwindow undershoot.left {
background-image: none;
-}
-
-entry {
- min-height: 26px;
-}
-
-tab {
- padding-left: 6px;
- padding-right: 6px;
} \ No newline at end of file
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/swtgtk_pre320.css b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/swt_common_gtk_pre320.css
index e0793706f5..6a03f5c66f 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/swtgtk_pre320.css
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/swt_common_gtk_pre320.css
@@ -1,20 +1,7 @@
-GtkToolbar {
- padding-top: 2px;
- padding-bottom: 2px;
-}
-
-GtkToolbar GtkButton {
- padding: 2px 4px 2px 4px;
-}
-
.undershoot.top, .undershoot.right, .undershoot.bottom, .undershoot.lef {
background-image: none;
}
-GtkToolbar GtkMenuButton {
- padding: 1px 0px 1px 0px;
-}
-
@binding-set SWTTreeViewBinding {
bind "Left" { "expand-collapse-cursor-row" (0,0,0)};
bind "Right" {"expand-collapse-cursor-row" (0,1,0)};

Back to the top