[Xfce4-commits] [panel-plugins/xfce4-cpufreq-plugin] 02/03: Simplify widget layout logic a bit.

noreply at xfce.org noreply at xfce.org
Mon Dec 22 18:51:19 CET 2014


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

hjudt pushed a commit to branch master
in repository panel-plugins/xfce4-cpufreq-plugin.

commit 21a91c784c5ae99081dfff4c28ae30e092003255
Author: Harald Judt <h.judt at gmx.at>
Date:   Sun Dec 21 17:37:50 2014 +0100

    Simplify widget layout logic a bit.
---
 panel-plugin/xfce4-cpufreq-plugin.c |    7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/panel-plugin/xfce4-cpufreq-plugin.c b/panel-plugin/xfce4-cpufreq-plugin.c
index 7c3e59f..ae36c90 100644
--- a/panel-plugin/xfce4-cpufreq-plugin.c
+++ b/panel-plugin/xfce4-cpufreq-plugin.c
@@ -190,6 +190,7 @@ cpufreq_widgets_layout (void)
 	cpuFreq->label_max_width = -1;
 	gtk_widget_set_size_request (GTK_WIDGET (cpuFreq->label), -1, -1);
 
+	/* keep plugin small if label is hidden or user requested compact size */
 	small = (hide_label ? TRUE : cpuFreq->options->keep_compact);
 
 	switch (cpuFreq->panel_mode) {
@@ -203,14 +204,10 @@ cpufreq_widgets_layout (void)
 		break;
 	case XFCE_PANEL_PLUGIN_MODE_DESKBAR:
 		orientation = small ? GTK_ORIENTATION_HORIZONTAL : GTK_ORIENTATION_VERTICAL;
-		xfce_panel_plugin_set_small (cpuFreq->plugin, FALSE);
+		xfce_panel_plugin_set_small (cpuFreq->plugin, hide_label ? TRUE : FALSE);
 		break;
 	}
 
-	/* always set plugin small state when only icon is shown */
-	if (hide_label)
-		xfce_panel_plugin_set_small (cpuFreq->plugin, TRUE);
-
 	/* check if the label fits below the icon, else put them side by side */
 	if (GTK_IS_WIDGET(cpuFreq->label) && ! hide_label) {
 		gtk_widget_size_request (cpuFreq->label, &label_size);

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


More information about the Xfce4-commits mailing list