[Xfce4-commits] [panel-plugins/xfce4-whiskermenu-plugin] 433/473: Update panel button icon when icon theme changes.

noreply at xfce.org noreply at xfce.org
Tue Feb 17 00:00:03 CET 2015


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

gottcode pushed a commit to branch master
in repository panel-plugins/xfce4-whiskermenu-plugin.

commit adb3b2bac5c697b4f30c6fef0566e64fbde11d71
Author: Graeme Gott <graeme at gottcode.org>
Date:   Wed Dec 10 18:33:41 2014 -0500

    Update panel button icon when icon theme changes.
---
 panel-plugin/plugin.cpp |   13 +++++++++++--
 panel-plugin/plugin.h   |    1 +
 2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/panel-plugin/plugin.cpp b/panel-plugin/plugin.cpp
index b1e49fc..b7f451a 100644
--- a/panel-plugin/plugin.cpp
+++ b/panel-plugin/plugin.cpp
@@ -127,6 +127,8 @@ Plugin::Plugin(XfcePanelPlugin* plugin) :
 	gtk_button_set_relief(GTK_BUTTON(m_button), GTK_RELIEF_NONE);
 	gtk_button_set_focus_on_click(GTK_BUTTON(m_button), false);
 	g_signal_connect_slot(m_button, "button-press-event", &Plugin::button_clicked, this);
+	g_signal_connect_slot<GtkWidget*,GtkStyle*>(m_button, "style-set", &Plugin::update_size, this);
+	g_signal_connect_slot<GtkWidget*,GdkScreen*>(m_button, "screen-changed", &Plugin::update_size, this);
 	gtk_widget_show(m_button);
 
 	m_button_box = GTK_BOX(gtk_hbox_new(false, 2));
@@ -335,13 +337,13 @@ void Plugin::configure()
 void Plugin::mode_changed(XfcePanelPlugin*, XfcePanelPluginMode mode)
 {
 	gtk_label_set_angle(m_button_label, (mode == XFCE_PANEL_PLUGIN_MODE_VERTICAL) ? 270: 0);
-	size_changed(m_plugin, xfce_panel_plugin_get_size(m_plugin));
+	update_size();
 }
 #else
 void Plugin::orientation_changed(XfcePanelPlugin*, GtkOrientation orientation)
 {
 	gtk_label_set_angle(m_button_label, (orientation == GTK_ORIENTATION_VERTICAL) ? 270: 0);
-	size_changed(m_plugin, xfce_panel_plugin_get_size(m_plugin));
+	update_size();
 }
 #endif
 
@@ -489,6 +491,13 @@ gboolean Plugin::size_changed(XfcePanelPlugin*, gint size)
 
 //-----------------------------------------------------------------------------
 
+void Plugin::update_size()
+{
+	size_changed(m_plugin, xfce_panel_plugin_get_size(m_plugin));
+}
+
+//-----------------------------------------------------------------------------
+
 void Plugin::popup_menu(bool at_cursor, bool activate_button)
 {
 	if (!at_cursor)
diff --git a/panel-plugin/plugin.h b/panel-plugin/plugin.h
index 42010a6..a9d03ee 100644
--- a/panel-plugin/plugin.h
+++ b/panel-plugin/plugin.h
@@ -70,6 +70,7 @@ private:
 	void save();
 	void show_about();
 	gboolean size_changed(XfcePanelPlugin*, gint size);
+	void update_size();
 	void popup_menu(bool at_cursor, bool activate_button);
 
 private:

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


More information about the Xfce4-commits mailing list