[Xfce4-commits] [panel-plugins/xfce4-whiskermenu-plugin] 01/18: Fix panel button icon alignment in deskbar mode.

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


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

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

commit 9f46bf4c2d2e93eb950ca93bf34f54c4ccab177c
Author: Graeme Gott <graeme at gottcode.org>
Date:   Tue Feb 25 13:44:43 2014 -0500

    Fix panel button icon alignment in deskbar mode.
---
 panel-plugin/plugin.cpp | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/panel-plugin/plugin.cpp b/panel-plugin/plugin.cpp
index f58096e..fca2892 100644
--- a/panel-plugin/plugin.cpp
+++ b/panel-plugin/plugin.cpp
@@ -342,6 +342,12 @@ gboolean Plugin::size_changed(XfcePanelPlugin*, gint size)
 	gint row_size = size;
 #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),
+			!wm_settings->button_title_visible,
+			!wm_settings->button_title_visible,
+			0, GTK_PACK_START);
+
 	// Resize icon
 	GtkStyle* style = gtk_widget_get_style(m_button);
 	gint border = (2 * std::max(style->xthickness, style->ythickness)) + 2;
@@ -356,9 +362,9 @@ gboolean Plugin::size_changed(XfcePanelPlugin*, gint size)
 		GtkRequisition label_size;
 		gtk_widget_size_request(GTK_WIDGET(m_button_label), &label_size);
 		if (mode == XFCE_PANEL_PLUGIN_MODE_DESKBAR &&
-		    wm_settings->button_title_visible &&
-		    wm_settings->button_icon_visible &&
-		    label_size.width <= (size - row_size))
+				wm_settings->button_title_visible &&
+				wm_settings->button_icon_visible &&
+				label_size.width <= (size - row_size))
 		{
 			orientation = GTK_ORIENTATION_HORIZONTAL;
 		}
@@ -370,21 +376,17 @@ gboolean Plugin::size_changed(XfcePanelPlugin*, gint size)
 #endif
 
 	// Fix alignment in deskbar mode
-        if (panel_orientation == GTK_ORIENTATION_VERTICAL &&
-	    orientation == GTK_ORIENTATION_HORIZONTAL)
+	if ((panel_orientation == GTK_ORIENTATION_VERTICAL) && (orientation == GTK_ORIENTATION_HORIZONTAL))
 	{
-		gtk_box_set_child_packing(m_button_box, GTK_WIDGET(m_button_icon), false, false, 0, GTK_PACK_START);
 		gtk_box_set_child_packing(m_button_box, GTK_WIDGET(m_button_label), false, false, 0, GTK_PACK_START);
 	}
 	else
 	{
-		gtk_box_set_child_packing(m_button_box, GTK_WIDGET(m_button_icon), true, false, 0, GTK_PACK_START);
 		gtk_box_set_child_packing(m_button_box, GTK_WIDGET(m_button_label), true, true, 0, GTK_PACK_START);
 	}
 
 	gtk_orientable_set_orientation(GTK_ORIENTABLE(m_button_box), orientation);
 
-
 	return true;
 }
 

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


More information about the Xfce4-commits mailing list