diff options
author | Carlos Garnacho <carlosg@gnome.org> | 2014-05-16 17:32:59 +0200 |
---|---|---|
committer | Carlos Garnacho <carlosg@gnome.org> | 2014-05-23 19:54:31 +0200 |
commit | bd5fb3a09f4bc300fb6517716a47340516a7916a (patch) | |
tree | 07b5159b021949ff36c510c8005dfeff82627188 | |
parent | b2d56c588ad548cf23e82028937cb299e9f8b720 (diff) | |
download | gtk+-bd5fb3a09f4bc300fb6517716a47340516a7916a.tar.gz |
textview: Show the magnifier popover a bit farther from the touch position
Somewhat arbitrary at the moment, would be nice to have minimal units
support for this, or at least hidpi support.
-rw-r--r-- | gtk/gtktextview.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/gtk/gtktextview.c b/gtk/gtktextview.c index 0d9fef9ac1..fdeb93238d 100644 --- a/gtk/gtktextview.c +++ b/gtk/gtktextview.c @@ -4680,18 +4680,22 @@ gtk_text_view_show_magnifier (GtkTextView *text_view, _gtk_text_view_ensure_magnifier (text_view); gtk_widget_get_allocation (GTK_WIDGET (text_view), &allocation); +#define RECT_WIDTH 40 + priv = text_view->priv; x = CLAMP (x, 0, allocation.width); y = CLAMP (y, 0, allocation.height); - rect.x = x; - rect.y = y; - rect.width = rect.height = 1; + rect.x = x - (RECT_WIDTH / 2); + rect.y = y - (RECT_WIDTH / 2); + rect.width = rect.height = RECT_WIDTH; _text_window_to_widget_coords (text_view, &rect.x, &rect.y); _gtk_magnifier_set_coords (GTK_MAGNIFIER (priv->magnifier), x, y); gtk_popover_set_pointing_to (GTK_POPOVER (priv->magnifier_popover), &rect); gtk_widget_show (priv->magnifier_popover); + +#undef RECT_WIDTH } static void |