[gimp/wip/Jehan/layers-dockable-refresh: 20/58] app: fix gimp_item_tree_view_blink_lock().




commit b76fa60ae037548dc3cc4e0be7fd5282778e3fca
Author: Jehan <jehan girinstud io>
Date:   Thu Feb 25 18:48:23 2021 +0100

    app: fix gimp_item_tree_view_blink_lock().
    
    The bin window coordinates must be converted to the widget coordinates.
    This was not a problem before, but now with the column header, if I
    don't do this, the position is wrong.
    
    Similarly fix the lock popover position.

 app/widgets/gimpitemtreeview.c | 4 ++++
 1 file changed, 4 insertions(+)
---
diff --git a/app/widgets/gimpitemtreeview.c b/app/widgets/gimpitemtreeview.c
index 62f09de81a..c32183f404 100644
--- a/app/widgets/gimpitemtreeview.c
+++ b/app/widgets/gimpitemtreeview.c
@@ -924,6 +924,8 @@ gimp_item_tree_view_blink_lock (GimpItemTreeView *view,
   gtk_tree_view_get_cell_area (GIMP_CONTAINER_TREE_VIEW (view)->view, path,
                                gtk_tree_view_get_column (GIMP_CONTAINER_TREE_VIEW (view)->view, 1),
                                &rect);
+  gtk_tree_view_convert_bin_window_to_widget_coords (GIMP_CONTAINER_TREE_VIEW (view)->view,
+                                                     rect.x, rect.y, &rect.x, &rect.y);
   gimp_widget_blink_rect (GTK_WIDGET (GIMP_CONTAINER_TREE_VIEW (view)->view), &rect);
 
   gtk_tree_path_free (path);
@@ -1762,6 +1764,8 @@ gimp_item_tree_view_lock_clicked (GtkCellRendererToggle *toggle,
       gtk_tree_view_get_cell_area (GIMP_CONTAINER_TREE_VIEW (view)->view, path,
                                    gtk_tree_view_get_column (GIMP_CONTAINER_TREE_VIEW (view)->view, 1),
                                    &rect);
+      gtk_tree_view_convert_bin_window_to_widget_coords (GIMP_CONTAINER_TREE_VIEW (view)->view,
+                                                         rect.x, rect.y, &rect.x, &rect.y);
       gtk_popover_set_pointing_to (GTK_POPOVER (view->priv->lock_popover), &rect);
 
       gtk_widget_show (view->priv->lock_popover);


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