[Xfce4-commits] [xfce/xfce4-panel] 01/01: Make sure panel plugin icons aren't clipped (LP #1756608)

noreply at xfce.org noreply at xfce.org
Fri Apr 5 22:03:42 CEST 2019


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 3abbe78bfa3c643f7d31338e97682d8490a09a59
Author: Simon Steinbeiss <simon.steinbeiss at elfenbeinturm.at>
Date:   Fri Apr 5 22:01:14 2019 +0200

    Make sure panel plugin icons aren't clipped (LP #1756608)
    
    Previously all icons <19px, ==34px and >39px were somewhat clipped with
    Adwaita. The current calculation consistently assumes we have at least
    4px internal padding/border on each plugin button and substracts that.
---
 libxfce4panel/xfce-panel-plugin.c | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/libxfce4panel/xfce-panel-plugin.c b/libxfce4panel/xfce-panel-plugin.c
index 8e41c3d..8f49c63 100644
--- a/libxfce4panel/xfce-panel-plugin.c
+++ b/libxfce4panel/xfce-panel-plugin.c
@@ -2092,21 +2092,27 @@ xfce_panel_plugin_get_icon_size (XfcePanelPlugin *plugin)
   g_return_val_if_fail (XFCE_IS_PANEL_PLUGIN (plugin), FALSE);
   g_return_val_if_fail (XFCE_PANEL_PLUGIN_CONSTRUCTED (plugin), FALSE);
 
+
   /* 0 is handled as 'automatic sizing' */
   if (plugin->priv->icon_size == 0)
     {
       width = xfce_panel_plugin_get_size (plugin) / xfce_panel_plugin_get_nrows (plugin);
 
       /* Since symbolic icons are usually only provided in 16px we
-      * try to be clever and use size steps */
-      if (width <= 27)
+      *  try to be clever and use size steps.
+         Some assumptions: We set 0px padding on panel buttons in the panel's internal
+         css, we expect that each button still has a 1px border, so we deduct 4px from
+         the panel width for the size steps to avoid clipping. */
+      if (width <= 19)
+        return 12;
+      else if (width <= 27)
         return 16;
-      else if (width < 34)
+      else if (width <= 35)
         return 24;
-      else if (width < 40)
+      else if (width <= 41)
         return 32;
       else
-        return width;
+        return width - 4;
     }
   else
     {

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


More information about the Xfce4-commits mailing list