mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-28 14:31:10 +00:00
searchbar: Fix clearing search entry on hide
Commit fa3d1940bf
added separate grab handling for GtkSearchEntry, but
didn't consider whether the bar was revealed or concealed. The expected
behavior for the latter is that the entry is cleared rather than focused,
fix the condition accordingly.
This commit is contained in:
parent
5d9799d4e3
commit
056a073061
@ -171,7 +171,7 @@ reveal_child_changed_cb (GObject *object,
|
||||
{
|
||||
if (reveal_child && GTK_IS_ENTRY (bar->entry))
|
||||
gtk_entry_grab_focus_without_selecting (GTK_ENTRY (bar->entry));
|
||||
else if (GTK_IS_SEARCH_ENTRY (bar->entry))
|
||||
else if (reveal_child && GTK_IS_SEARCH_ENTRY (bar->entry))
|
||||
gtk_widget_grab_focus (bar->entry);
|
||||
else
|
||||
gtk_editable_set_text (GTK_EDITABLE (bar->entry), "");
|
||||
|
Loading…
Reference in New Issue
Block a user