[Xfce4-commits] [apps/xfce4-dict] 01/04: Get panel icon size from xfce_panel_plugin_get_icon_size
noreply at xfce.org
noreply at xfce.org
Wed Nov 28 02:08:33 CET 2018
This is an automated email from the git hooks/post-receive script.
a n d r e 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 apps/xfce4-dict.
commit 73a911c93f6b8f6de35ed005ba5a935d2b917c47
Author: Andre Miranda <andreldm at xfce.org>
Date: Tue Nov 27 21:53:42 2018 -0300
Get panel icon size from xfce_panel_plugin_get_icon_size
---
panel-plugin/xfce4-dict-plugin.c | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/panel-plugin/xfce4-dict-plugin.c b/panel-plugin/xfce4-dict-plugin.c
index 25e0252..43366f7 100644
--- a/panel-plugin/xfce4-dict-plugin.c
+++ b/panel-plugin/xfce4-dict-plugin.c
@@ -55,18 +55,24 @@ static gboolean entry_is_dirty = FALSE;
static gboolean dict_plugin_panel_set_size(XfcePanelPlugin *plugin, gint wsize, DictPanelData *dpd)
{
- GtkBorder border;
+ GtkBorder border;
GtkStyleContext *context;
gint size;
gint bsize = wsize;
bsize /= xfce_panel_plugin_get_nrows (plugin);
+#if LIBXFCE4PANEL_CHECK_VERSION (4,13,0)
+ size = xfce_panel_plugin_get_icon_size(plugin);
+#else
+ size = bsize;
+#endif
+
+ /* Take the border width into account */
context = gtk_widget_get_style_context (GTK_WIDGET (dpd->panel_button));
gtk_style_context_get_border (context, gtk_widget_get_state_flags (GTK_WIDGET (dpd->panel_button)), &border);
- size = bsize - 2 * MAX (border.left + border.right, border.top + border.bottom);
+ size -= 2 * MAX (border.left + border.right, border.top + border.bottom);
- dpd->dd->icon = gdk_pixbuf_new_from_resource_at_scale("/org/xfce/dict/icon",
- size, -1, TRUE, NULL);
+ dpd->dd->icon = gdk_pixbuf_new_from_resource_at_scale("/org/xfce/dict/icon", size, -1, TRUE, NULL);
gtk_image_set_from_pixbuf(GTK_IMAGE(dpd->panel_button_image), dpd->dd->icon);
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Xfce4-commits
mailing list