mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-17 14:30:15 +00:00
textview: Perform tougher handle visibility checks after hiding the popover
The handles might fall outside the visible area, and shouldn't be shown then. Just call gtk_text_view_update_handles() which will perform these checks, and keep the handle conveniently hidden. This was leading to unexpectedly visible handles (and in the wrong/previous position, the handle code doesn't relocate the widget it's about to hide) when "select all" was selected in the popover on a textview needing scrollbars. and extending the selection beyond the view above and/or below.
This commit is contained in:
parent
2be6d09c9e
commit
c11906fcdb
@ -9202,14 +9202,12 @@ show_or_hide_handles (GtkWidget *popover,
|
||||
handle = text_view->priv->text_handle;
|
||||
mode = _gtk_text_handle_get_mode (handle);
|
||||
|
||||
if (mode == GTK_TEXT_HANDLE_MODE_CURSOR)
|
||||
if (!visible)
|
||||
gtk_text_view_update_handles (text_view, mode);
|
||||
else
|
||||
{
|
||||
_gtk_text_handle_set_visible (handle, GTK_TEXT_HANDLE_POSITION_CURSOR, !visible);
|
||||
}
|
||||
else if (mode == GTK_TEXT_HANDLE_MODE_SELECTION)
|
||||
{
|
||||
_gtk_text_handle_set_visible (handle, GTK_TEXT_HANDLE_POSITION_SELECTION_START, !visible);
|
||||
_gtk_text_handle_set_visible (handle, GTK_TEXT_HANDLE_POSITION_SELECTION_END, !visible);
|
||||
_gtk_text_handle_set_visible (handle, GTK_TEXT_HANDLE_POSITION_SELECTION_START, FALSE);
|
||||
_gtk_text_handle_set_visible (handle, GTK_TEXT_HANDLE_POSITION_SELECTION_END, FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user