From 0b3835a93f0cd8c373e67ab691d337a1e1a0cbcc Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Tue, 9 Jun 2015 17:06:27 -0400 Subject: [PATCH] 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 file changed, 6 insertions(+), 2 deletions(-) diff --git a/gtk/gtktexthandle.c b/gtk/gtktexthandle.c index c816ff2f45..e3c9854fc8 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);