[Xfce4-commits] [panel-plugins/xfce4-fsguard-plugin] 01/01: Set progressbar minimal width and height depending on the orientation (#12942)

noreply at xfce.org noreply at xfce.org
Sat Dec 24 22:59:11 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-fsguard-plugin.

commit 45044f88ce648ccd0718c806638e4e9eeeb1db32
Author: Landry Breuil <landry at xfce.org>
Date:   Sat Dec 24 22:57:52 2016 +0100

    Set progressbar minimal width and height depending on the orientation (#12942)
    
    See https://git.xfce.org/panel-plugins/xfce4-battery-plugin/commit/?id=2ab3a4ba61665083059af54271d8ccc30926776f
    
    Enforce a monitor refresh upon mode change.
---
 panel-plugin/fsguard.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/panel-plugin/fsguard.c b/panel-plugin/fsguard.c
index ab02da7..79d9514 100644
--- a/panel-plugin/fsguard.c
+++ b/panel-plugin/fsguard.c
@@ -199,9 +199,13 @@ fsguard_refresh_monitor (FsGuard *fsguard)
 #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 * cssminsizes = "min-width: 4px; min-height: 0px";
+    if (gtk_orientable_get_orientation(GTK_ORIENTABLE(fsguard->progress_bar)) == GTK_ORIENTATION_HORIZONTAL)
+        cssminsizes = "min-width: 0px; min-height: 4px";
+    gchar * css = g_strdup_printf("progressbar trough { %s } \
+                                   progressbar progress { %s ; \
                                                           background-color: %s; background-image: none; }",
+                                  cssminsizes, cssminsizes,
 #else
     gchar * css = g_strdup_printf(".progressbar { background-color: %s; background-image: none; }",
 #endif
@@ -533,6 +537,7 @@ fsguard_set_mode (XfcePanelPlugin *plugin, XfcePanelPluginMode mode, FsGuard *fs
     gtk_box_reorder_child (GTK_BOX (fsguard->lab_box),
                            orientation == GTK_ORIENTATION_VERTICAL ? fsguard->lab_size : fsguard->lab_name, 0);
     fsguard_set_size (plugin, xfce_panel_plugin_get_size (plugin), fsguard);
+    fsguard_refresh_monitor (fsguard);
 }
 
 static void

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


More information about the Xfce4-commits mailing list