[gtk+] GtkTextHandle: position handles properly



commit 0b3835a93f0cd8c373e67ab691d337a1e1a0cbcc
Author: Matthias Clasen <mclasen redhat com>
Date:   Tue Jun 9 17:06:27 2015 -0400

    GtkTextHandle: position handles properly
    
    Move the handles so that the asymmetric assets align with the
    start/end of the selection.

 gtk/gtktexthandle.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/gtk/gtktexthandle.c b/gtk/gtktexthandle.c
index c816ff2..e3c9854 100644
--- a/gtk/gtktexthandle.c
+++ b/gtk/gtktexthandle.c
@@ -387,15 +387,19 @@ _gtk_text_handle_update (GtkTextHandle         *handle,
                                         rect.x, rect.y, &rect.x, &rect.y);
 
       if (pos == GTK_TEXT_HANDLE_POSITION_CURSOR)
-        handle_pos = GTK_POS_BOTTOM;
+        {
+          handle_pos = GTK_POS_BOTTOM;
+          if (priv->mode == GTK_TEXT_HANDLE_MODE_CURSOR)
+            rect.x -= rect.width / 2;
+        }
       else
         {
           handle_pos = GTK_POS_TOP;
           rect.y += handle_window->pointing_to.height;
+          rect.x -= rect.width;
         }
 
       height += handle_window->pointing_to.height;
-      rect.x -= rect.width / 2;
 
       gtk_widget_set_size_request (handle_window->widget, width, height);
       gtk_widget_show (handle_window->widget);


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