[gtk/1464-tree-view-expander-arrows-no-longer-positioned-vertically-centered-correctly] treeview: Respect expander-size style property.



commit 5d46f3c2e7a359f9cf71552e9ac82b9e1dc5c109
Author: António Fernandes <antoniof gnome org>
Date:   Thu Feb 13 20:25:48 2020 +0000

    treeview: Respect expander-size style property.
    
    An expander arrows's render width is supposed to be derived from the
    "expander-size" style property.
    
    However, we are actually rendering it for a width equal to
    expander-size + 1. This results in ugly blurry rendering.
    
    There is a comment justifying this "+ 1", which has been there for
    almost 2 decades. But the justification doesn't seem to apply to
    the current code, so the original motivation is likely obsolete.
    
    Let's remove this "+ 1" to render the arrow to a width exactly equal
    to the "expander-size" style property.

 gtk/gtktreeview.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
---
diff --git a/gtk/gtktreeview.c b/gtk/gtktreeview.c
index f857c623cd..c81d26359f 100644
--- a/gtk/gtktreeview.c
+++ b/gtk/gtktreeview.c
@@ -9581,8 +9581,7 @@ gtk_tree_view_get_arrow_xrange (GtkTreeView *tree_view,
 
   if (tmp_column &&
       gtk_tree_view_column_get_visible (tmp_column))
-    /* +1 because x2 isn't included in the range. */
-    *x2 = *x1 + expander_render_size + 1;
+    *x2 = *x1 + expander_render_size;
   else
     *x2 = *x1;
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]