[Xfce4-commits] [xfce/xfce4-power-manager] 03/03: Battery plugin: Set size on style_set signal

noreply at xfce.org noreply at xfce.org
Tue Jul 15 00:39:36 CEST 2014


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

ochosi pushed a commit to branch master
in repository xfce/xfce4-power-manager.

commit 86a199545d0387fce884d9fc94e9afdfa0452419
Author: Harald Judt <h.judt at gmx.at>
Date:   Mon Jul 14 22:29:16 2014 +0200

    Battery plugin: Set size on style_set signal
    
    When the GTK theme changes, resize the panel button and its icon.
---
 panel-plugins/battery/battery-button.c |   10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/panel-plugins/battery/battery-button.c b/panel-plugins/battery/battery-button.c
index 09f9258..6b37fde 100644
--- a/panel-plugins/battery/battery-button.c
+++ b/panel-plugins/battery/battery-button.c
@@ -524,6 +524,13 @@ battery_button_size_changed_cb (XfcePanelPlugin *plugin, gint size, BatteryButto
     return battery_button_set_icon (button);
 }
 
+void
+battery_button_style_set_cb (XfcePanelPlugin *plugin, GtkStyle *prev_style, BatteryButton *button)
+{
+    gtk_widget_reset_rc_styles (GTK_WIDGET (plugin));
+    battery_button_size_changed_cb (plugin, xfce_panel_plugin_get_size (plugin), button);
+}
+
 static void
 battery_button_free_data_cb (XfcePanelPlugin *plugin, BatteryButton *button)
 {
@@ -564,6 +571,9 @@ battery_button_show (BatteryButton *button)
     g_signal_connect (button->priv->plugin, "size-changed",
                       G_CALLBACK (battery_button_size_changed_cb), button);
 
+    g_signal_connect (button->priv->plugin, "style-set",
+                      G_CALLBACK (battery_button_style_set_cb), button);
+
     g_signal_connect (button->priv->plugin, "free-data",
                       G_CALLBACK (battery_button_free_data_cb), button);
 #endif

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


More information about the Xfce4-commits mailing list