[Xfce4-commits] [xfce/xfce4-panel] 01/01: launcher: Rely on icon-size provided by panel
noreply at xfce.org
noreply at xfce.org
Mon Nov 26 23:49:20 CET 2018
This is an automated email from the git hooks/post-receive script.
o c h o s i p u s h e d a c o m m i t t o b r a n c h m a s t e r
in repository xfce/xfce4-panel.
commit ca31a0852196223aec87cd6356be05f22999c6e1
Author: Simon Steinbeiss <simon.steinbeiss at elfenbeinturm.at>
Date: Mon Nov 26 23:48:39 2018 +0100
launcher: Rely on icon-size provided by panel
---
plugins/launcher/launcher.c | 15 ++++-----------
1 file changed, 4 insertions(+), 11 deletions(-)
diff --git a/plugins/launcher/launcher.c b/plugins/launcher/launcher.c
index 57c9c1d..bf957d8 100644
--- a/plugins/launcher/launcher.c
+++ b/plugins/launcher/launcher.c
@@ -1330,28 +1330,21 @@ launcher_plugin_size_changed (XfcePanelPlugin *panel_plugin,
gtk_widget_set_size_request (GTK_WIDGET (panel_plugin), -1, -1);
}
else {
- GtkStyleContext *context;
- GtkBorder padding, border;
- gint icon_width, icon_height;
-
- context = gtk_widget_get_style_context (plugin->button);
- gtk_style_context_get_padding (context, gtk_widget_get_state_flags (plugin->button), &padding);
- gtk_style_context_get_border (context, gtk_widget_get_state_flags (plugin->button), &border);
- icon_width = p_width - (padding.left + padding.right + border.left + border.right);
- icon_height = p_height - (padding.top + padding.bottom + border.top + border.bottom);
+ gint icon_size;
+ icon_size = xfce_panel_plugin_get_icon_size (panel_plugin);
/* if the icon is a pixbuf we have to recreate and scale it */
if (plugin->pixbuf != NULL &&
plugin->icon_name != NULL) {
g_object_unref (plugin->pixbuf);
plugin->pixbuf = gdk_pixbuf_new_from_file_at_size (plugin->icon_name,
- icon_width, icon_height,
+ icon_size, icon_size,
NULL);
gtk_image_set_from_pixbuf (GTK_IMAGE (plugin->child), plugin->pixbuf);
}
/* set the panel plugin icon size */
else {
- gtk_image_set_pixel_size (GTK_IMAGE (plugin->child), MIN (icon_width, icon_height));
+ gtk_image_set_pixel_size (GTK_IMAGE (plugin->child), MIN (icon_size, icon_size));
}
}
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Xfce4-commits
mailing list