Add typeahead find feature

Search on commit list will start as soon as you type
This commit is contained in:
Alberto Fanjul 2019-04-19 05:58:37 +02:00
parent 83d3802b33
commit d8a198ab2f
5 changed files with 12 additions and 1 deletions

View file

@ -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())

View file

@ -1134,7 +1134,6 @@ namespace GitgHistory
set
{
d_main.commit_list_view.set_search_entry(value);
d_main.commit_list_view.set_enable_search(value != null);
if (value != null)
{

View file

@ -19,6 +19,7 @@
<property name="has_focus">True</property>
<property name="fixed-height-mode">True</property>
<property name="headers-visible">False</property>
<property name="enable-search">False</property>
<child>
<object class="GtkTreeViewColumn" id="column_commit_list_subject">
<property name="title" translatable="yes">Subject</property>

View file

@ -88,6 +88,7 @@
<property name="has_focus">True</property>
<property name="fixed-height-mode">True</property>
<property name="headers-visible">False</property>
<property name="enable-search">False</property>
<child>
<object class="GtkTreeViewColumn" id="column_commit_list_subject">
<property name="title" translatable="yes">Subject</property>

View file

@ -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>