[Xfce4-commits] <xfce4-cpufreq-plugin:master> Always use a single row when only the icon is shown.
Harald Judt
noreply at xfce.org
Tue Aug 20 20:26:05 CEST 2013
Updating branch refs/heads/master
to b94f3166b60696a1f19364049031cda07ee52c7d (commit)
from 9073a09b3b48b1ed72b4554cc0e348577346b14d (commit)
commit b94f3166b60696a1f19364049031cda07ee52c7d
Author: Harald Judt <h.judt at gmx.at>
Date: Tue Aug 20 19:49:17 2013 +0200
Always use a single row when only the icon is shown.
panel-plugin/xfce4-cpufreq-plugin.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/panel-plugin/xfce4-cpufreq-plugin.c b/panel-plugin/xfce4-cpufreq-plugin.c
index 054fe37..99d9514 100644
--- a/panel-plugin/xfce4-cpufreq-plugin.c
+++ b/panel-plugin/xfce4-cpufreq-plugin.c
@@ -165,9 +165,13 @@ cpufreq_widgets_layout (void)
GtkOrientation orientation;
gboolean small = cpuFreq->options->keep_compact;
gboolean resized = FALSE;
+ gboolean hide_label = (!cpuFreq->options->show_label_freq &&
+ !cpuFreq->options->show_label_governor);
gint panel_size, pos = 1;
gint lw = 0, lh = 0, iw = 0, ih = 0;
+ small = (hide_label ? TRUE : cpuFreq->options->keep_compact);
+
switch (cpuFreq->panel_mode) {
case XFCE_PANEL_PLUGIN_MODE_HORIZONTAL:
orientation = small ? GTK_ORIENTATION_HORIZONTAL : GTK_ORIENTATION_VERTICAL;
@@ -183,9 +187,13 @@ cpufreq_widgets_layout (void)
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 */
panel_size = xfce_panel_plugin_get_size(cpuFreq->plugin);
- if (GTK_IS_WIDGET(cpuFreq->label)) {
+ if (GTK_IS_WIDGET(cpuFreq->label) && ! hide_label) {
gtk_widget_size_request (cpuFreq->label, &label_size);
lw = label_size.width;
lh = label_size.height;
More information about the Xfce4-commits
mailing list