[gnome-terminal] window: Move tabs menu into an arrow button on the notebook
- From: Christian Persch <chpe src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-terminal] window: Move tabs menu into an arrow button on the notebook
- Date: Tue, 14 Jul 2015 20:03:13 +0000 (UTC)
commit 055fe364a7ab5606a6d47e88f67c60a22cd99b5b
Author: Christian Persch <chpe gnome org>
Date: Tue Jul 14 22:02:27 2015 +0200
window: Move tabs menu into an arrow button on the notebook
https://bugzilla.gnome.org/show_bug.cgi?id=745329
src/terminal-tabs-menu.c | 2 +-
src/terminal-window.c | 15 +++++++++++++++
src/terminal.xml | 4 +++-
3 files changed, 19 insertions(+), 2 deletions(-)
---
diff --git a/src/terminal-tabs-menu.c b/src/terminal-tabs-menu.c
index fb2b966..574fa8e 100644
--- a/src/terminal-tabs-menu.c
+++ b/src/terminal-tabs-menu.c
@@ -44,7 +44,7 @@
#define ACCEL_PATH_FORMAT_LENGTH strlen (ACCEL_PATH_FORMAT) + 14 + 1
#define DATA_KEY "TerminalTabsMenu::Action"
-#define UI_PATH "/menubar/Tabs"
+#define UI_PATH "/TabsPopup"
#define TERMINAL_TABS_MENU_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object),
TERMINAL_TYPE_TABS_MENU, TerminalTabsMenuPrivate))
diff --git a/src/terminal-window.c b/src/terminal-window.c
index dd0a4c4..e065ac1 100644
--- a/src/terminal-window.c
+++ b/src/terminal-window.c
@@ -2152,6 +2152,7 @@ terminal_window_fill_notebook_action_box (TerminalWindow *window)
TerminalWindowPrivate *priv = window->priv;
GtkWidget *box, *button;
GtkAction *action;
+ GtkWidget *menu;
box = terminal_notebook_get_action_box (TERMINAL_NOTEBOOK (priv->mdi_container), GTK_PACK_END);
@@ -2162,6 +2163,19 @@ terminal_window_fill_notebook_action_box (TerminalWindow *window)
gtk_activatable_set_related_action (GTK_ACTIVATABLE (button), action);
gtk_box_pack_start (GTK_BOX (box), button, FALSE, FALSE, 0);
gtk_widget_show (button);
+
+ /* Create Tabs menu button */
+ menu = gtk_ui_manager_get_widget (priv->ui_manager, "/TabsPopup");
+ gtk_widget_set_halign (menu, GTK_ALIGN_END);
+
+ button = gtk_menu_button_new ();
+ gtk_button_set_relief (GTK_BUTTON (button), FALSE);
+ gtk_button_set_focus_on_click (GTK_BUTTON (button), FALSE);
+ gtk_menu_button_set_popup (GTK_MENU_BUTTON (button), menu);
+
+ gtk_box_pack_start (GTK_BOX (box), button, FALSE, FALSE, 0);
+ gtk_menu_button_set_align_widget (GTK_MENU_BUTTON (button), box);
+ gtk_widget_show (button);
}
/*****************************************/
@@ -2392,6 +2406,7 @@ terminal_window_init (TerminalWindow *window)
{ "Help", NULL, N_("_Help") },
{ "Popup", NULL, NULL },
{ "NotebookPopup", NULL, "" },
+ { "TabsPopup", NULL, "" },
/* File menu */
{ "FileNewWindow", STOCK_NEW_WINDOW, N_("Open _Terminal"), "<shift><control>N",
diff --git a/src/terminal.xml b/src/terminal.xml
index d280f79..d2065b3 100644
--- a/src/terminal.xml
+++ b/src/terminal.xml
@@ -105,5 +105,7 @@
<menuitem action="TabsMoveRight"/>
<separator />
<menuitem action="FileCloseTab"/>
- </popup>
+ </popup>
+ <popup name="TabsPopup" action="TabsPopup" accelerators="true">
+ </popup>
</ui>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]