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

noreply at xfce.org noreply at xfce.org
Mon Feb 16 23:58:31 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 038bb945cb59e729447ab84c68698945b4bdcbbe
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 2ffbb6f..5964bcc 100644
--- a/panel-plugin/plugin.cpp
+++ b/panel-plugin/plugin.cpp
@@ -389,6 +389,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;
@@ -403,9 +409,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;
 		}
@@ -417,21 +423,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