[gnome-software] Look sharp in HighContrast too



commit faff370bdd646b78fb691d9e39fc9a6ce6a93e5b
Author: Matthias Clasen <mclasen redhat com>
Date:   Fri Sep 20 19:06:06 2013 -0400

    Look sharp in HighContrast too
    
    The HighContrast theme is all about, well, high contrast.
    Therefore, we should remove our fancy shadows and most other
    theming.

 src/Makefile.am                  |    1 +
 src/gnome-software.gresource.xml |    1 +
 src/gs-application.c             |    9 ++++++++-
 src/gtk-style-hc.css             |   22 ++++++++++++++++++++++
 4 files changed, 32 insertions(+), 1 deletions(-)
---
diff --git a/src/Makefile.am b/src/Makefile.am
index fb8ee4d..c15890e 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -128,6 +128,7 @@ EXTRA_DIST =                                                \
        gnome-software.gresource.xml                    \
        gnome-software.xml                              \
        gtk-style.css                                   \
+       gtk-style-hc.css                                        \
        shadow.png                                      \
        shadow-active.png                               \
        $(desktop_in_files)                             \
diff --git a/src/gnome-software.gresource.xml b/src/gnome-software.gresource.xml
index 37bf130..9fd5ce0 100644
--- a/src/gnome-software.gresource.xml
+++ b/src/gnome-software.gresource.xml
@@ -9,6 +9,7 @@
   <file preprocess="xml-stripblanks">app-tile.ui</file>
   <file preprocess="xml-stripblanks">app-widget.ui</file>
   <file>gtk-style.css</file>
+  <file>gtk-style-hc.css</file>
   <file preprocess="to-pixdata">shadow.png</file>
   <file preprocess="to-pixdata">shadow-active.png</file>
  </gresource>
diff --git a/src/gs-application.c b/src/gs-application.c
index fd284d5..c10ec9a 100644
--- a/src/gs-application.c
+++ b/src/gs-application.c
@@ -122,6 +122,7 @@ gs_application_startup (GApplication *application)
        GtkWindow *window;
        GFile *file;
        GError *error = NULL;
+       gchar *theme;
 
        G_APPLICATION_CLASS (gs_application_parent_class)->startup (application);
 
@@ -146,9 +147,15 @@ gs_application_startup (GApplication *application)
        gtk_style_context_add_provider_for_screen (gdk_screen_get_default (),
                                                   GTK_STYLE_PROVIDER (app->provider),
                                                   GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
-       file = g_file_new_for_uri ("resource:///org/gnome/software/gtk-style.css");
+       g_object_get (gtk_settings_get_default (), "gtk-theme-name", &theme, NULL);
+       if (g_strcmp0 (theme, "HighContrast") == 0) {
+               file = g_file_new_for_uri ("resource:///org/gnome/software/gtk-style-hc.css");
+       } else {
+               file = g_file_new_for_uri ("resource:///org/gnome/software/gtk-style.css");
+       }
        gtk_css_provider_load_from_file (app->provider, file, NULL);
        g_object_unref (file);
+       g_free (theme);
 
        /* setup pk */
        app->task = pk_task_new ();
diff --git a/src/gtk-style-hc.css b/src/gtk-style-hc.css
new file mode 100644
index 0000000..78d5efa
--- /dev/null
+++ b/src/gtk-style-hc.css
@@ -0,0 +1,22 @@
+.installed-overlay-box {
+       font-size: 80%;
+       background-color: @theme_button_active_bg;
+       border-radius: 4px;
+       color: @theme_base_color;
+}
+
+.installed-overlay-label { }
+
+ keyframes throbbing {
+        0% { background-image: linear-gradient(to bottom, transparent, transparent); }
+}
+
+.needs-attention {
+        background-image: linear-gradient(to bottom, @theme_button_active_bg, @theme_button_active_bg);
+        animation: throbbing linear 1s infinite alternate;
+}
+
+.application-details-title {
+       font-weight: bold;
+       font-size: 14px;
+}


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