[gtk/wip/carlosg/for-master: 3/8] gtk/treeview: Position editable widgets correctly wrt left border




commit 3d84a388677bd07ea185c0b28598a15a8cede688
Author: Carlos Garnacho <carlosg gnome org>
Date:   Fri Dec 11 17:56:14 2020 +0100

    gtk/treeview: Position editable widgets correctly wrt left border
    
    The coordinates are already widget-local here, not transformed by the
    adjustment positions. Using the adjustment value here ends up pushing
    the entry far from the left border.
    
    The correct minimum value here is 0, which matches the treeview left
    border.
    
    Fixes: https://gitlab.gnome.org/GNOME/gtk/-/issues/3009

 gtk/gtktreeview.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/gtk/gtktreeview.c b/gtk/gtktreeview.c
index dda21f82aa..82d5fd97d8 100644
--- a/gtk/gtktreeview.c
+++ b/gtk/gtktreeview.c
@@ -2627,10 +2627,10 @@ gtk_tree_view_size_allocate (GtkWidget *widget,
        * preferring the top left corner (for RTL)
        * or top right corner (for LTR)
        */
-      min_x = gtk_adjustment_get_value (priv->hadjustment);
+      min_x = 0;
       max_x = min_x + width - child_rect.width;
       min_y = 0;
-        max_y = min_y + height - gtk_tree_view_get_effective_header_height (tree_view) - child_rect.height;
+      max_y = min_y + height - gtk_tree_view_get_effective_header_height (tree_view) - child_rect.height;
 
       if (direction == GTK_TEXT_DIR_LTR)
         /* Ensure that child's right edge is not sticking to the right


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