[epiphany] ephy-find-toolbar: Toggle the search bar with Ctrl+F
- From: Michael Catanzaro <mcatanzaro src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [epiphany] ephy-find-toolbar: Toggle the search bar with Ctrl+F
- Date: Wed, 4 Mar 2015 14:40:39 +0000 (UTC)
commit 085f73a88bcd033175808196b77accb52b1e79fe
Author: Yosef Or Boczko <yoseforb src gnome org>
Date: Wed Aug 6 18:09:41 2014 +0300
ephy-find-toolbar: Toggle the search bar with Ctrl+F
If the search bar are shown, Ctrl+F will hide it.
Otherwise Ctrl+F will show the search bar and than
focus the search entry.
https://bugzilla.gnome.org/show_bug.cgi?id=734316
embed/ephy-find-toolbar.c | 13 +++++++++++++
embed/ephy-find-toolbar.h | 2 ++
src/window-commands.c | 2 +-
3 files changed, 16 insertions(+), 1 deletions(-)
---
diff --git a/embed/ephy-find-toolbar.c b/embed/ephy-find-toolbar.c
index 20553e8..3126a58 100644
--- a/embed/ephy-find-toolbar.c
+++ b/embed/ephy-find-toolbar.c
@@ -713,3 +713,16 @@ ephy_find_toolbar_request_close (EphyFindToolbar *toolbar)
g_signal_emit (toolbar, signals[CLOSE], 0);
}
}
+
+void
+ephy_find_toolbar_toggle_state (EphyFindToolbar *toolbar)
+{
+ if (gtk_search_bar_get_search_mode (GTK_SEARCH_BAR (toolbar)))
+ {
+ ephy_find_toolbar_close (toolbar);
+ }
+ else
+ {
+ ephy_find_toolbar_open (toolbar, FALSE, FALSE);
+ }
+}
diff --git a/embed/ephy-find-toolbar.h b/embed/ephy-find-toolbar.h
index 62113e7..4bb9ed9 100644
--- a/embed/ephy-find-toolbar.h
+++ b/embed/ephy-find-toolbar.h
@@ -78,6 +78,8 @@ void ephy_find_toolbar_close (EphyFindToolbar *toolbar);
void ephy_find_toolbar_request_close (EphyFindToolbar *toolbar);
+void ephy_find_toolbar_toggle_state (EphyFindToolbar *toolbar);
+
G_END_DECLS
#endif /* EPHY_FIND_TOOLBAR_H */
diff --git a/src/window-commands.c b/src/window-commands.c
index 43c6a4e..9443e3f 100644
--- a/src/window-commands.c
+++ b/src/window-commands.c
@@ -1091,7 +1091,7 @@ window_cmd_edit_find (GtkAction *action,
EphyFindToolbar *toolbar;
toolbar = EPHY_FIND_TOOLBAR (ephy_window_get_current_find_toolbar (window));
- ephy_find_toolbar_open (toolbar, FALSE, FALSE);
+ ephy_find_toolbar_toggle_state (toolbar);
}
void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]