[Xfce4-commits] [panel-plugins/xfce4-whiskermenu-plugin] 03/09: Fix incorrect fetching of panel orientation in Xfce 4.10.

noreply at xfce.org noreply at xfce.org
Sat Aug 20 18:34:25 CEST 2016


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

gottcode pushed a commit to annotated tag v1.2.2
in repository panel-plugins/xfce4-whiskermenu-plugin.

commit 07d9f35b3200a5ccc32dcc822825fd51185fd2ee
Author: Graeme Gott <graeme at gottcode.org>
Date:   Wed Nov 20 08:18:45 2013 -0500

    Fix incorrect fetching of panel orientation in Xfce 4.10.
---
 src/panel_plugin.cpp | 21 +++++++++++++++------
 src/panel_plugin.hpp |  2 +-
 2 files changed, 16 insertions(+), 7 deletions(-)

diff --git a/src/panel_plugin.cpp b/src/panel_plugin.cpp
index d5b5bf0..530ecc8 100644
--- a/src/panel_plugin.cpp
+++ b/src/panel_plugin.cpp
@@ -130,7 +130,7 @@ PanelPlugin::PanelPlugin(XfcePanelPlugin* plugin) :
 	// Connect plugin signals to functions
 	g_signal_connect(plugin, "free-data", G_CALLBACK(whiskermenu_free), this);
 	g_signal_connect(plugin, "configure-plugin", G_CALLBACK(PanelPlugin::configure_slot), this);
-#if (LIBXFCE4PANEL_CHECK_VERSION(4,10,0))
+#if (LIBXFCE4PANEL_CHECK_VERSION(4,9,0))
 	g_signal_connect(plugin, "mode-changed", G_CALLBACK(PanelPlugin::mode_changed_slot), this);
 #else
 	g_signal_connect(plugin, "orientation-changed", G_CALLBACK(PanelPlugin::orientation_changed_slot), this);
@@ -138,7 +138,14 @@ PanelPlugin::PanelPlugin(XfcePanelPlugin* plugin) :
 	g_signal_connect(plugin, "remote-event", G_CALLBACK(PanelPlugin::remote_event_slot), this);
 	g_signal_connect_swapped(plugin, "save", G_CALLBACK(PanelPlugin::save_slot), this);
 	g_signal_connect(plugin, "size-changed", G_CALLBACK(PanelPlugin::size_changed_slot), this);
+
 	xfce_panel_plugin_menu_show_configure(plugin);
+
+#if (LIBXFCE4PANEL_CHECK_VERSION(4,9,0))
+	mode_changed_slot(m_plugin, xfce_panel_plugin_get_mode(m_plugin), this);
+#else
+	orientation_changed_slot(m_plugin, xfce_panel_plugin_get_orientation(m_plugin), this);
+#endif
 }
 
 //-----------------------------------------------------------------------------
@@ -336,13 +343,15 @@ void PanelPlugin::save()
 
 bool PanelPlugin::size_changed(int size)
 {
-#if (LIBXFCE4PANEL_CHECK_VERSION(4,10,0))
+#if (LIBXFCE4PANEL_CHECK_VERSION(4,9,0))
 	gint row_size = size / xfce_panel_plugin_get_nrows(m_plugin);
+	XfcePanelPluginMode mode = xfce_panel_plugin_get_mode(m_plugin);
+	GtkOrientation orientation = (mode == XFCE_PANEL_PLUGIN_MODE_HORIZONTAL)
+			? GTK_ORIENTATION_HORIZONTAL : GTK_ORIENTATION_VERTICAL;
 #else
 	gint row_size = size;
-#endif
-
 	GtkOrientation orientation = xfce_panel_plugin_get_orientation(m_plugin);
+#endif
 
 	// Make icon expand to fill button if title is not visible
 	gtk_box_set_child_packing(GTK_BOX(m_button_box), GTK_WIDGET(m_button_icon),
@@ -369,9 +378,9 @@ bool PanelPlugin::size_changed(int size)
 		xfce_panel_image_set_size(m_button_icon, row_size - border);
 		gtk_widget_set_size_request(GTK_WIDGET(m_plugin), -1, -1);
 
-#if (LIBXFCE4PANEL_CHECK_VERSION(4,10,0))
+#if (LIBXFCE4PANEL_CHECK_VERSION(4,9,0))
 		// Put title next to icon if panel is wide enough
-		if (xfce_panel_plugin_get_mode(m_plugin) == XFCE_PANEL_PLUGIN_MODE_DESKBAR)
+		if (mode == XFCE_PANEL_PLUGIN_MODE_DESKBAR)
 		{
 			GtkRequisition label_size;
 			gtk_widget_size_request(GTK_WIDGET(m_button_label), &label_size);
diff --git a/src/panel_plugin.hpp b/src/panel_plugin.hpp
index ce0df66..93a8d72 100644
--- a/src/panel_plugin.hpp
+++ b/src/panel_plugin.hpp
@@ -127,7 +127,7 @@ private:
 		return obj->size_changed(size);
 	}
 
-#if (LIBXFCE4PANEL_CHECK_VERSION(4,10,0))
+#if (LIBXFCE4PANEL_CHECK_VERSION(4,9,0))
 	static void mode_changed_slot(XfcePanelPlugin*, XfcePanelPluginMode mode, PanelPlugin* obj)
 	{
 		obj->orientation_changed(mode == XFCE_PANEL_PLUGIN_MODE_VERTICAL);

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


More information about the Xfce4-commits mailing list