[gnome-software] Show the search bar when the user does ctrl+f
- From: Richard Hughes <rhughes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software] Show the search bar when the user does ctrl+f
- Date: Wed, 12 Oct 2016 11:10:14 +0000 (UTC)
commit 7f61062f2fa398266e2ca15151577d19f38ec8c0
Author: Richard Hughes <richard hughsie com>
Date: Wed Oct 12 11:43:55 2016 +0100
Show the search bar when the user does ctrl+f
Resolves: https://bugzilla.gnome.org/show_bug.cgi?id=772358
src/gs-shell.c | 11 +++++++++++
1 files changed, 11 insertions(+), 0 deletions(-)
---
diff --git a/src/gs-shell.c b/src/gs-shell.c
index 8cf2927..dc4c470 100644
--- a/src/gs-shell.c
+++ b/src/gs-shell.c
@@ -543,6 +543,17 @@ window_keypress_handler (GtkWidget *window, GdkEvent *event, GsShell *shell)
GsShellPrivate *priv = gs_shell_get_instance_private (shell);
GtkWidget *widget;
widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "search_bar"));
+
+ /* handle ctrl+f shortcut */
+ if (event->type == GDK_KEY_PRESS) {
+ GdkEventKey *e = (GdkEventKey *) event;
+ if ((e->state & GDK_CONTROL_MASK) > 0 &&
+ e->keyval == GDK_KEY_f) {
+ gtk_search_bar_set_search_mode (GTK_SEARCH_BAR (widget), TRUE);
+ return GDK_EVENT_PROPAGATE;
+ }
+ }
+
return gtk_search_bar_handle_event (GTK_SEARCH_BAR (widget), event);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]