[geary/geary-0.12] Workaround Ubuntu Ambiance and Radiance theme bugs in GTK+ 3.14-3.18.



commit 143ee81b98873ee5674d98f903f536230b030553
Author: Michael James Gratton <mike vee net>
Date:   Tue Feb 6 09:58:36 2018 +1100

    Workaround Ubuntu Ambiance and Radiance theme bugs in GTK+ 3.14-3.18.
    
    Fixes bug 772752.
    
    * src/client/components/main-window.vala (MainWindow): Load new CSS file
      containing workarounds for Ambiance themes.

 src/client/components/main-window.vala |   14 ++++++++++++++
 ui/CMakeLists.txt                      |    1 +
 ui/ambiance.css                        |    7 +++++++
 3 files changed, 22 insertions(+), 0 deletions(-)
---
diff --git a/src/client/components/main-window.vala b/src/client/components/main-window.vala
index 165e6c4..cb917d1 100644
--- a/src/client/components/main-window.vala
+++ b/src/client/components/main-window.vala
@@ -165,6 +165,20 @@ public class MainWindow : Gtk.ApplicationWindow {
         } catch (Error e) {
             error("Could not load CSS: %s", e.message);
         }
+
+        switch (Gtk.Settings.get_default().gtk_theme_name) {
+        case "Ambiance":
+        case "Radiance":
+            // Add workarounds for Ubuntu Ambiance and Radiance theme
+            // bugs in GTK+ 3.14-3.18.
+            try {
+                File file = File.new_for_uri(@"resource:///org/gnome/Geary/ambiance.css");
+                provider.load_from_file(file);
+            } catch (Error e) {
+                error("Could not load CSS: %s", e.message);
+            }
+            break;
+        }
     }
 
     private void setup_layout(Configuration config) {
diff --git a/ui/CMakeLists.txt b/ui/CMakeLists.txt
index dc41091..3e313ee 100644
--- a/ui/CMakeLists.txt
+++ b/ui/CMakeLists.txt
@@ -4,6 +4,7 @@ set(RESOURCE_LIST
   STRIPBLANKS "account_cannot_remove.glade"
   STRIPBLANKS "account_list.glade"
   STRIPBLANKS "account_spinner.glade"
+              "ambiance.css"
   STRIPBLANKS "certificate_warning_dialog.glade"
               "client-web-view.js"
               "client-web-view-allow-remote-images.js"
diff --git a/ui/ambiance.css b/ui/ambiance.css
new file mode 100644
index 0000000..edcf796
--- /dev/null
+++ b/ui/ambiance.css
@@ -0,0 +1,7 @@
+/*
+ * Workarounds for Ubuntu Ambiance and Radiance theme bugs for GTK+ 3.14-3.18.
+ */
+
+.dim-label {
+  color: mix (@theme_fg_color, @theme_bg_color, 0.50);
+}


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]