[Xfce4-commits] [xfce/exo] 01/01: Fix for the bugs 16075 and 16107

noreply at xfce.org noreply at xfce.org
Fri Nov 15 12:39:43 CET 2019


This is an automated email from the git hooks/post-receive script.

b   l   u   e   s   a   b   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 xfce/exo.

commit 6fcefce9f1e7bb34cb65290c37f889481a677130
Author: Adam Purkrt <adam at purkrt.net>
Date:   Sat Nov 2 16:44:00 2019 +0100

    Fix for the bugs 16075 and 16107
    
    Bug: 16075
    Bug: 16107
    
    The following patch fixes bugs 16075 and 16107, i.e.
    "Icon view: excess clickable area of multiline filenames" and
    "Multi-line filenames misaligned when text beside icons is on"
    respectively. By relying on gtk_cell_renderer_get_aligned_area and
    gtk_cell_renderer_get_padding it brings the box[..].width and
    box[..].height values into correspondence with the real size of
    drawn text.
    
    Signed-off-by: Sean Davis <smd.seandavis at gmail.com>
---
 exo/exo-icon-view.c | 21 +++++++++++++++++++--
 1 file changed, 19 insertions(+), 2 deletions(-)

diff --git a/exo/exo-icon-view.c b/exo/exo-icon-view.c
index 607c80a..667973b 100644
--- a/exo/exo-icon-view.c
+++ b/exo/exo-icon-view.c
@@ -3915,8 +3915,25 @@ exo_icon_view_calculate_item_size (ExoIconView     *icon_view,
         gtk_cell_renderer_get_preferred_size (info->cell, GTK_WIDGET (icon_view),
                                               &req, NULL);
 
-        item->box[info->position].width = req.width;
-        item->box[info->position].height = req.height;
+        if (info->is_text)
+          {
+            GdkRectangle cell_area, aligned_area;
+            gint cell_xpad, cell_ypad;
+
+            cell_area.width = req.width;
+            cell_area.height = req.height;
+            gtk_cell_renderer_get_aligned_area (info->cell, GTK_WIDGET (icon_view),
+                                                0, &cell_area, &aligned_area);
+            gtk_cell_renderer_get_padding (info->cell, &cell_xpad, &cell_ypad);
+
+            item->box[info->position].width = aligned_area.width + 2*cell_xpad;
+            item->box[info->position].height = aligned_area.height + 2*cell_ypad;
+          }
+        else
+          {
+            item->box[info->position].width = req.width;
+            item->box[info->position].height = req.height;
+          }
       }
 #else
       gtk_cell_renderer_get_size (info->cell, GTK_WIDGET (icon_view),

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


More information about the Xfce4-commits mailing list