[Xfce4-commits] <xfce4-cpufreq-plugin:master> Better handle icon size.

Harald Judt noreply at xfce.org
Sun Aug 18 11:32:20 CEST 2013


Updating branch refs/heads/master
         to 73ca04dd894bbbda394fbae2f1fee2bca70047f6 (commit)
       from 5a26a2b4b3948f85cf75a6baf16e4903cde5ef68 (commit)

commit 73ca04dd894bbbda394fbae2f1fee2bca70047f6
Author: Harald Judt <h.judt at gmx.at>
Date:   Sun Aug 11 15:06:52 2013 +0200

    Better handle icon size.
    
    The icon looked cut off in vertical panel mode, so change the size dependent
    on the save space option. Might still need some bit of tweaking, but let's
    leave it for now.

 panel-plugin/xfce4-cpufreq-configure.c |    8 +++++++-
 panel-plugin/xfce4-cpufreq-plugin.c    |    2 --
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/panel-plugin/xfce4-cpufreq-configure.c b/panel-plugin/xfce4-cpufreq-configure.c
index 67cbe25..f51ec57 100644
--- a/panel-plugin/xfce4-cpufreq-configure.c
+++ b/panel-plugin/xfce4-cpufreq-configure.c
@@ -51,9 +51,15 @@ check_button_changed (GtkWidget *button, CpuFreqPluginConfigure *configure)
 		cpuFreq->options->show_label_governor =
 			gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (button));
 
-	else if (button == configure->keep_compact)
+	else if (button == configure->keep_compact) {
 		cpuFreq->options->keep_compact =
 			gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (button));
+		if (cpuFreq->options->keep_compact)
+			cpuFreq->icon_size -= 4;
+		else
+			cpuFreq->icon_size += 4;
+		cpufreq_update_icon (cpuFreq);
+	}
 
 	cpufreq_prepare_label (cpuFreq);
 	cpufreq_update_plugin ();
diff --git a/panel-plugin/xfce4-cpufreq-plugin.c b/panel-plugin/xfce4-cpufreq-plugin.c
index f19b9d3..3607719 100644
--- a/panel-plugin/xfce4-cpufreq-plugin.c
+++ b/panel-plugin/xfce4-cpufreq-plugin.c
@@ -262,7 +262,6 @@ cpufreq_widgets (void)
 
 	cpuFreq->icon_size = xfce_panel_plugin_get_size (cpuFreq->plugin);
 	cpuFreq->icon_size /= xfce_panel_plugin_get_nrows (cpuFreq->plugin);
-	cpuFreq->icon_size -= 2;
 
 	/* create panel toggle button which will contain all other widgets */
 	cpuFreq->button = xfce_create_panel_toggle_button ();
@@ -384,7 +383,6 @@ static gboolean
 cpufreq_set_size (XfcePanelPlugin *plugin, gint size, CpuFreqPlugin *cpufreq)
 {
 	cpuFreq->icon_size = size / xfce_panel_plugin_get_nrows (cpuFreq->plugin);
-	cpuFreq->icon_size -= 2;
 
 	cpufreq_update_icon (cpufreq);
 	cpufreq_update_plugin ();


More information about the Xfce4-commits mailing list