[gnome-todo] task-row: Consider margins when setting hotspot



commit 05f4fac0e4238dcd24f56641e93a316d2fa66df5
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Wed Nov 1 07:32:31 2017 -0200

    task-row: Consider margins when setting hotspot

 src/gtd-task-row.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
---
diff --git a/src/gtd-task-row.c b/src/gtd-task-row.c
index 75e4bfb..e4e9c19 100644
--- a/src/gtd-task-row.c
+++ b/src/gtd-task-row.c
@@ -219,6 +219,7 @@ drag_begin_cb (GtkWidget      *event_box,
                GtdTaskRow     *self)
 {
   GtkWidget *widget, *new_row;
+  gint x_offset;
 
   widget = GTK_WIDGET (self);
 
@@ -230,8 +231,15 @@ drag_begin_cb (GtkWidget      *event_box,
    */
   new_row = create_transient_row (self);
 
+  if (gtk_widget_get_direction (GTK_WIDGET (self)) == GTK_TEXT_DIR_RTL)
+    x_offset = gtk_widget_get_margin_end (GTK_WIDGET (self));
+  else
+    x_offset = gtk_widget_get_margin_start (GTK_WIDGET (self));
 
-  gtk_drag_set_icon_widget (context, new_row, self->clicked_x, self->clicked_y);
+  gtk_drag_set_icon_widget (context,
+                            new_row,
+                            self->clicked_x + x_offset,
+                            self->clicked_y);
 
   gtk_widget_hide (widget);
 }


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