[Xfce4-commits] [xfce/xfce4-power-manager] 01/05: Use libxfce4panel function to obtain desired icon size

noreply at xfce.org noreply at xfce.org
Fri Oct 27 16:32:29 CEST 2017


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-power-manager.

commit b667211b6acc2de182d1275afc822009c22b0855
Author: Viktor Odintsev <ninetls at xfce.org>
Date:   Fri Sep 15 06:06:03 2017 +0300

    Use libxfce4panel function to obtain desired icon size
---
 panel-plugins/power-manager-plugin/power-manager-button.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/panel-plugins/power-manager-plugin/power-manager-button.c b/panel-plugins/power-manager-plugin/power-manager-button.c
index 0069f3b..ad3088c 100644
--- a/panel-plugins/power-manager-plugin/power-manager-button.c
+++ b/panel-plugins/power-manager-plugin/power-manager-button.c
@@ -1072,11 +1072,13 @@ power_manager_button_press_event (GtkWidget *widget, GdkEventButton *event)
 static void
 power_manager_button_size_changed_cb (XfcePanelPlugin *plugin, gint size, PowerManagerButton *button)
 {
+#if !LIBXFCE4PANEL_CHECK_VERSION (4, 13, 0)
     GtkStyleContext *context;
     GtkBorder padding, border;
     gint width;
     gint xthickness;
     gint ythickness;
+#endif
 
     g_return_if_fail (POWER_MANAGER_IS_BUTTON (button));
     g_return_if_fail (XFCE_IS_PANEL_PLUGIN (plugin));
@@ -1084,6 +1086,9 @@ power_manager_button_size_changed_cb (XfcePanelPlugin *plugin, gint size, PowerM
 
     size /= xfce_panel_plugin_get_nrows (plugin);
 
+#if LIBXFCE4PANEL_CHECK_VERSION (4, 13, 0)
+    button->priv->panel_icon_width = xfce_panel_plugin_get_icon_size (plugin);
+#else
     /* Calculate the size of the widget because the theme can override it */
     context = gtk_widget_get_style_context (GTK_WIDGET (button));
     gtk_style_context_get_padding (context, gtk_widget_get_state_flags (GTK_WIDGET (button)), &padding);
@@ -1104,6 +1109,7 @@ power_manager_button_size_changed_cb (XfcePanelPlugin *plugin, gint size, PowerM
         button->priv->panel_icon_width = 32;
     else
         button->priv->panel_icon_width = width;
+#endif
 
     /* resize the plugin */
     gtk_widget_set_size_request (GTK_WIDGET (plugin), size, size);

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


More information about the Xfce4-commits mailing list