[yelp/new-aday-design] yelp-window: Don't show find bar when search bar is shown
- From: Shaun McCance <shaunm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [yelp/new-aday-design] yelp-window: Don't show find bar when search bar is shown
- Date: Tue, 17 Jun 2014 22:44:49 +0000 (UTC)
commit bf0a9de726b09a51f5fdc730e8e2cba836a80b77
Author: Shaun McCance <shaunm gnome org>
Date: Tue Jun 17 14:38:06 2014 -0400
yelp-window: Don't show find bar when search bar is shown
src/yelp-window.c | 16 ++++++++++++++++
1 files changed, 16 insertions(+), 0 deletions(-)
---
diff --git a/src/yelp-window.c b/src/yelp-window.c
index bb81c31..68262de 100644
--- a/src/yelp-window.c
+++ b/src/yelp-window.c
@@ -85,6 +85,9 @@ static void app_bookmarks_changed (YelpApplication *app,
static void window_set_bookmarks (YelpWindow *window,
const gchar *doc_uri);
static void window_set_bookmark_buttons (YelpWindow *window);
+static void window_search_mode (GtkSearchBar *search_bar,
+ GParamSpec *pspec,
+ YelpWindow *window);
static void action_new_window (GSimpleAction *action,
GVariant *parameter,
@@ -385,6 +388,8 @@ window_construct (YelpWindow *window)
g_object_bind_property (button, "active",
priv->search_bar, "search-mode-enabled",
G_BINDING_BIDIRECTIONAL);
+ g_signal_connect (priv->search_bar, "notify::search-mode-enabled",
+ G_CALLBACK (window_search_mode), window);
gtk_header_bar_pack_end (GTK_HEADER_BAR (priv->header), button);
g_signal_connect (window, "key-press-event", G_CALLBACK (window_key_press), NULL);
@@ -948,6 +953,17 @@ window_set_bookmark_buttons (YelpWindow *window)
g_object_unref (uri);
}
+static void
+window_search_mode (GtkSearchBar *search_bar,
+ GParamSpec *pspec,
+ YelpWindow *window)
+{
+ YelpWindowPrivate *priv = GET_PRIV (window);
+
+ if (gtk_search_bar_get_search_mode (GTK_SEARCH_BAR (search_bar)))
+ gtk_search_bar_set_search_mode (GTK_SEARCH_BAR (priv->find_bar), FALSE);
+}
+
static gboolean
find_entry_key_press (GtkEntry *entry,
GdkEventKey *event,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]