[gitg/wip/albfan/type-to-search] Add type to search
- From: Alberto Fanjul <albfan src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gitg/wip/albfan/type-to-search] Add type to search
- Date: Fri, 19 Apr 2019 03:59:19 +0000 (UTC)
commit feb096bd368a705c039d45cf9379eff93b8a4278
Author: Alberto Fanjul <albertofanjul gmail com>
Date: Fri Apr 19 05:58:37 2019 +0200
Add type to search
gitg/gitg-window.vala | 9 +++++++++
gitg/resources/ui/gitg-window.ui | 1 +
2 files changed, 10 insertions(+)
---
diff --git a/gitg/gitg-window.vala b/gitg/gitg-window.vala
index 10eb95ea..47fd2d91 100644
--- a/gitg/gitg-window.vala
+++ b/gitg/gitg-window.vala
@@ -266,6 +266,15 @@ public class Window : Gtk.ApplicationWindow, GitgExt.Application, Initable
}
}
+ [GtkCallback]
+ public bool on_key_pressed (Gtk.Widget widget, Gdk.EventKey event) {
+ bool ret = d_search_bar.handle_event(event);
+ if (ret) {
+ d_search_bar.search_mode_enabled = true;
+ }
+ return ret;
+ }
+
construct
{
if (Gitg.PlatformSupport.use_native_window_controls())
diff --git a/gitg/resources/ui/gitg-window.ui b/gitg/resources/ui/gitg-window.ui
index 115b957f..6259dbd3 100644
--- a/gitg/resources/ui/gitg-window.ui
+++ b/gitg/resources/ui/gitg-window.ui
@@ -9,6 +9,7 @@
<property name="default_width">1000</property>
<property name="default_height">600</property>
<property name="icon_name">gitg</property>
+ <signal name="key-press-event" after="yes" handler="on_key_pressed"/>
<child type="titlebar">
<object class="GtkHeaderBar" id="d_header_bar">
<property name="visible">True</property>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]