Commit db4dbf80 authored by Matteo Cappadonna's avatar Matteo Cappadonna

src/photos-searchbar.c: Changed ctrl+a behaviour in search

Currently while searching photos by text, hitting the Ctrl+a key will
select all photos that matched the query.

This can lead to unwanted behaviour, like searching for a term then
hitting Ctrl+a Backspace in order to change the query term; this
delete all found images.

To fix this, changed the search bar code for key pressing event in
order to select the text instead of the photos.

GNOME/gnome-photos#124
parent b3b0da71
Pipeline #85266 passed with stages
in 23 minutes and 36 seconds
......@@ -253,6 +253,14 @@ photos_searchbar_handle_event (PhotosSearchbar *self, GdkEventKey *event)
goto out;
}
/* Ctrl+a select all text in the search bar */
if (search_mode_enabled && (event->state == GDK_CONTROL_MASK) && (event->keyval == GDK_KEY_a))
{
gtk_widget_grab_focus (priv->search_entry);
ret_val = GDK_EVENT_STOP;
goto out;
}
ret_val = gtk_search_bar_handle_event (GTK_SEARCH_BAR (self), (GdkEvent *) event);
if (ret_val == GDK_EVENT_STOP)
gtk_entry_grab_focus_without_selecting (GTK_ENTRY (priv->search_entry));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment