[gitg] Focus entry when search button is active
- From: Ignacio Casal Quinteiro <icq src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gitg] Focus entry when search button is active
- Date: Thu, 21 Feb 2013 08:01:52 +0000 (UTC)
commit 5269dcc28566dad0251a6068cf1923f991966af8
Author: Ignacio Casal Quinteiro <icq gnome org>
Date: Thu Feb 21 09:01:30 2013 +0100
Focus entry when search button is active
gitg/gitg-window.vala | 9 ++++++++-
1 files changed, 8 insertions(+), 1 deletions(-)
---
diff --git a/gitg/gitg-window.vala b/gitg/gitg-window.vala
index 56dae14..2d1e61c 100644
--- a/gitg/gitg-window.vala
+++ b/gitg/gitg-window.vala
@@ -97,9 +97,16 @@ public class Window : Gtk.ApplicationWindow, GitgExt.Application, Initable, Gtk.
d_header_bar = builder.get_object("header-bar") as Gd.HeaderBar;
var search_button = builder.get_object("search-button") as Gd.HeaderToggleButton;
var revealer = builder.get_object("search-revealer") as Gd.Revealer;
- search_button.bind_property("active", revealer, "reveal-child");
var entry = builder.get_object("search-entry") as Gd.TaggedEntry;
+ search_button.bind_property("active", revealer, "reveal-child");
+ search_button.toggled.connect((b) => {
+ if (b.get_active())
+ {
+ entry.grab_focus();
+ }
+ });
+
var settings = new Settings("org.gnome.gitg.preferences.interface");
settings.bind("orientation",
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]