[Xfce4-commits] [xfce/xfce4-power-manager] 01/01: Fix wrong panel plugin button size (bug #11898)
noreply at xfce.org
noreply at xfce.org
Thu Jun 4 15:27:48 CEST 2015
This is an automated email from the git hooks/post-receive script.
hjudt pushed a commit to branch master
in repository xfce/xfce4-power-manager.
commit fad62e2ae968eb1dde59fd43d615d4547872ea63
Author: Harald Judt <h.judt at gmx.at>
Date: Thu Jun 4 15:21:48 2015 +0200
Fix wrong panel plugin button size (bug #11898)
In deskbar mode, the button takes up too much vertical space and is not
a square. Setting an extra resize request for the button fixes it.
---
panel-plugins/power-manager-plugin/power-manager-button.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/panel-plugins/power-manager-plugin/power-manager-button.c b/panel-plugins/power-manager-plugin/power-manager-button.c
index ea4a795..fd47138 100644
--- a/panel-plugins/power-manager-plugin/power-manager-button.c
+++ b/panel-plugins/power-manager-plugin/power-manager-button.c
@@ -957,11 +957,11 @@ power_manager_button_size_changed_cb (XfcePanelPlugin *plugin, gint size, PowerM
context = gtk_widget_get_style_context (GTK_WIDGET (button));
gtk_style_context_get_padding (context, gtk_widget_get_state_flags (GTK_WIDGET (button)), &padding);
gtk_style_context_get_border (context, gtk_widget_get_state_flags (GTK_WIDGET (button)), &border);
- xthickness = padding.left+padding.right+border.left+border.right;
- ythickness = padding.top+padding.bottom+border.top+border.bottom;
+ xthickness = padding.left + padding.right + border.left + border.right;
+ ythickness = padding.top + padding.bottom + border.top + border.bottom;
/* Calculate the size of the space left for the icon */
- width = size - 2* MAX (xthickness, ythickness);
+ width = size - 2 * MAX (xthickness, ythickness);
/* Since symbolic icons are usually only provided in 16px we
* try to be clever and use size steps */
@@ -974,8 +974,12 @@ power_manager_button_size_changed_cb (XfcePanelPlugin *plugin, gint size, PowerM
else
button->priv->panel_icon_width = width;
- gtk_widget_set_size_request (GTK_WIDGET(plugin), size, size);
+ /* resize the plugin */
+ gtk_widget_set_size_request (GTK_WIDGET (plugin), size, size);
power_manager_button_set_icon (button);
+
+ /* resize the plugin button too */
+ gtk_widget_set_size_request (GTK_WIDGET (button), -1, -1);
}
static void
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Xfce4-commits
mailing list