[epiphany] Change notebook menu to use radio buttons
- From: Michael Catanzaro <mcatanzaro src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [epiphany] Change notebook menu to use radio buttons
- Date: Mon, 16 Jan 2017 22:52:00 +0000 (UTC)
commit f79225d3337cbac3d4ca998946d37260055d58fc
Author: Michael Catanzaro <mcatanzaro gnome org>
Date: Mon Jan 16 16:47:52 2017 -0600
Change notebook menu to use radio buttons
src/ephy-window.c | 9 ++++++++-
src/window-commands.c | 9 +++++++++
src/window-commands.h | 3 +++
3 files changed, 20 insertions(+), 1 deletions(-)
---
diff --git a/src/ephy-window.c b/src/ephy-window.c
index 69c29a2..e9b7cff 100644
--- a/src/ephy-window.c
+++ b/src/ephy-window.c
@@ -782,7 +782,7 @@ static const GActionEntry window_entries [] =
{ "location", window_cmd_go_location },
{ "home", window_cmd_go_home },
- { "show-tab", window_cmd_show_tab, "u" },
+ { "show-tab", window_cmd_show_tab, "u", "uint32 0", window_cmd_change_show_tab_state },
/* Toggle actions */
{ "browse-with-caret", NULL, NULL, "false", window_cmd_change_browse_with_caret_state },
@@ -2585,6 +2585,8 @@ notebook_switch_page_cb (GtkNotebook *notebook,
EphyWindow *window)
{
EphyEmbed *embed;
+ GActionGroup *group;
+ GAction *action;
LOG ("switch-page notebook %p position %u\n", notebook, page_num);
@@ -2596,6 +2598,11 @@ notebook_switch_page_cb (GtkNotebook *notebook,
/* update new tab */
ephy_window_set_active_tab (window, embed);
+
+ /* update notebook menu */
+ group = gtk_widget_get_action_group (GTK_WIDGET (window), "win");
+ action = g_action_map_lookup_action (G_ACTION_MAP (group), "show-tab");
+ g_simple_action_set_state (G_SIMPLE_ACTION (action), g_variant_new_uint32 (page_num));
}
static GtkNotebook *
diff --git a/src/window-commands.c b/src/window-commands.c
index 0f40992..f712bb3 100644
--- a/src/window-commands.c
+++ b/src/window-commands.c
@@ -2327,4 +2327,13 @@ window_cmd_show_tab (GSimpleAction *action,
notebook = ephy_window_get_notebook (window);
gtk_notebook_set_current_page (GTK_NOTEBOOK (notebook), tab_num);
+ g_simple_action_set_state (action, parameter);
+}
+
+void
+window_cmd_change_show_tab_state (GSimpleAction *action,
+ GVariant *parameter,
+ gpointer user_data)
+{
+ /* This page intentionally left blank. */
}
diff --git a/src/window-commands.h b/src/window-commands.h
index 5db5771..ed78dab 100644
--- a/src/window-commands.h
+++ b/src/window-commands.h
@@ -182,5 +182,8 @@ void window_cmd_tabs_close (GSimpleAction *action,
void window_cmd_show_tab (GSimpleAction *action,
GVariant *parameter,
gpointer user_data);
+void window_cmd_change_show_tab_state (GSimpleAction *action,
+ GVariant *state,
+ gpointer user_data);
G_END_DECLS
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]