[Xfce4-commits] [panel-plugins/xfce4-diskperf-plugin] 01/01: Only set progressbar width *or* height depending on the orientation (#12942)

noreply at xfce.org noreply at xfce.org
Sat Dec 24 22:09:56 CET 2016


This is an automated email from the git hooks/post-receive script.

landry pushed a commit to branch master
in repository panel-plugins/xfce4-diskperf-plugin.

commit dd61ff6ef11fe610a47d4938cb9ac9b5482f35eb
Author: Landry Breuil <landry at xfce.org>
Date:   Sat Dec 24 22:01:05 2016 +0100

    Only set progressbar width *or* height depending on the orientation (#12942)
    
    Note that with certain themes, you might still see a *tiny* 1px glitch,
    but that's because your gtk theme hasnt been updated with the Adwaita
    fixes in https://bugzilla.gnome.org/show_bug.cgi?id=774695#c7.
    
    Tested working fine (and looking good!) with Adwaita and Greybird themes,
    using Gtk+ 3.22.5.
    
    Paper or Zukitre themes still show the tiny glitch, but at least not a 4px bar
    when the value is zero. Of course tested with both panel orientations...
---
 panel-plugin/main.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/panel-plugin/main.c b/panel-plugin/main.c
index 8712aec..4ac830c 100644
--- a/panel-plugin/main.c
+++ b/panel-plugin/main.c
@@ -329,14 +329,17 @@ static int SetSingleBarColor (struct diskperf_t *p_poPlugin, int p_iBar)
 #if GTK_CHECK_VERSION (3, 16, 0)
     GtkCssProvider *css_provider;
 #if GTK_CHECK_VERSION (3, 20, 0)
-    gchar * css = g_strdup_printf("progressbar trough { min-width: 4px; min-height: 4px; } \
-                                   progressbar progress { min-width: 4px; min-height: 4px; \
+    gchar * cssorient = (gtk_orientable_get_orientation(GTK_ORIENTABLE(*pwBar)) == GTK_ORIENTATION_VERTICAL ? "width" : "height");
+    gchar * css = g_strdup_printf("progressbar trough { min-%s: 4px } \
+                                   progressbar progress { min-%s: 4px ;\
                                                           background-color: %s; background-image: none; }",
+                                  cssorient, cssorient,
 #else
     gchar * css = g_strdup_printf(".progressbar { background-color: %s; background-image: none; }",
 #endif
                                   gdk_rgba_to_string(&poConf->aoColor[p_iBar]));
     /* Setup Gtk style */
+    DBG("setting css to %s", css);
     css_provider = gtk_css_provider_new ();
     gtk_css_provider_load_from_data (css_provider, css, strlen(css), NULL);
     gtk_style_context_add_provider (

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list