[Commits] [SCM] claws branch, master, updated. 3.10.1-129-gb1a697d

claws at claws-mail.org claws at claws-mail.org
Fri Jul 25 08:10:42 CEST 2014


The branch, master has been updated
       via  b1a697d628595ef353ded83e7af5e8ebde47f56b (commit)
      from  973011215ffad1e1b2acdcfab52f042bd8823ce7 (commit)

Summary of changes:
 src/mainwindow.c   |   25 ++++++++++++++++++++++++-
 src/prefs_common.c |    2 ++
 src/prefs_common.h |    1 +
 3 files changed, 27 insertions(+), 1 deletion(-)


- Log -----------------------------------------------------------------
commit b1a697d628595ef353ded83e7af5e8ebde47f56b
Author: Paul <paul at claws-mail.org>
Date:   Fri Jul 25 07:10:26 2014 +0100

    add option to toggle mainwindow menubar, (hotkey F12)

diff --git a/src/mainwindow.c b/src/mainwindow.c
index dffcd3b..5004852 100644
--- a/src/mainwindow.c
+++ b/src/mainwindow.c
@@ -201,6 +201,8 @@ static void show_all_header_cb		(GtkAction	*action,
 				  gpointer	 data);
 static void toggle_fullscreen_cb	(GtkAction	*action,
 				  gpointer	 data);
+static void toggle_menubar_cb	(GtkAction	*action,
+				  gpointer	 data);
 
 static void hide_quotes_cb(GtkAction	*action,
 				  gpointer	 data);
@@ -803,6 +805,7 @@ static GtkActionEntry mainwin_entries[] =
 
 static GtkToggleActionEntry mainwin_toggle_entries[] = {
 	{"File/OfflineMode",			NULL, N_("Offline _mode"), "<control>W", NULL, G_CALLBACK(toggle_work_offline_cb) }, /*toggle*/
+	{"View/ShowHide/MenuBar",		NULL, N_("_Menubar"), "F12", NULL, G_CALLBACK(toggle_menubar_cb) }, /* toggle */
 	{"View/ShowHide/MessageView",		NULL, N_("_Message view"), "V", NULL, G_CALLBACK(toggle_message_cb) }, /* toggle */
 #ifndef GENERIC_UMPC
 	{"View/ShowHide/StatusBar",		NULL, N_("Status _bar"), NULL, NULL, G_CALLBACK(toggle_statusbar_cb) }, /* toggle */
@@ -1543,6 +1546,7 @@ MainWindow *main_window_create()
 
 /* View menu */
 	MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View", "ShowHide", "View/ShowHide", GTK_UI_MANAGER_MENU)
+	MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/ShowHide", "MenuBar", "View/ShowHide/MenuBar", GTK_UI_MANAGER_MENUITEM)
 	MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/ShowHide", "Toolbar", "View/ShowHide/Toolbar", GTK_UI_MANAGER_MENU)
 	MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/ShowHide/Toolbar", "TextBelowIcon", "View/ShowHide/Toolbar/TextBelowIcon", GTK_UI_MANAGER_MENUITEM)
 	MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/ShowHide/Toolbar", "TextBesideIcon", "View/ShowHide/Toolbar/TextBesideIcon", GTK_UI_MANAGER_MENUITEM)
@@ -1874,7 +1878,10 @@ MainWindow *main_window_create()
 
 
 	menubar = gtk_ui_manager_get_widget(mainwin->ui_manager, "/Menu");
-	gtk_widget_show_all(menubar);
+	if (prefs_common.mainwin_menubar)
+		gtk_widget_show_all(menubar);
+	else
+		gtk_widget_hide(menubar);
 	gtk_window_add_accel_group(GTK_WINDOW(window), gtk_ui_manager_get_accel_group(mainwin->ui_manager));
 
 	gtk_box_pack_start(GTK_BOX(vbox), menubar, FALSE, TRUE, 0);
@@ -2206,6 +2213,9 @@ MainWindow *main_window_create()
 			"Menu/View/FullScreen",
 			TRUE);
 	}
+	if (prefs_common.mainwin_menubar)
+		cm_toggle_menu_set_active_full(mainwin->ui_manager,"Menu/View/ShowHide/MenuBar", TRUE);
+	
 	return mainwin;
 }
 
@@ -4366,6 +4376,19 @@ static void toggle_fullscreen_cb(GtkAction *action, gpointer data)
 	}
 }
 
+static void toggle_menubar_cb(GtkAction *action, gpointer data)
+{
+	MainWindow *mainwin = (MainWindow *)data;
+	if (mainwin->menu_lock_count) return;
+	if (!gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action))) {
+		gtk_widget_hide(GTK_WIDGET(mainwin->menubar));
+		prefs_common.mainwin_menubar = FALSE;
+	} else {
+		gtk_widget_show(GTK_WIDGET(mainwin->menubar));
+		prefs_common.mainwin_menubar = TRUE;
+	}
+}
+
 static void hide_quotes_cb(GtkAction *action, gpointer data)
 {
 	MainWindow *mainwin = (MainWindow *)data;
diff --git a/src/prefs_common.c b/src/prefs_common.c
index a417b0d..25ac2be 100644
--- a/src/prefs_common.c
+++ b/src/prefs_common.c
@@ -638,6 +638,8 @@ static PrefParam param[] = {
 	 NULL, NULL, NULL},
 	{"mainwin_fullscreen", "FALSE", &prefs_common.mainwin_fullscreen, P_BOOL,
 	 NULL, NULL, NULL},
+	{"mainwin_menubar", "TRUE", &prefs_common.mainwin_menubar, P_BOOL,
+	 NULL, NULL, NULL},
 #ifndef GENERIC_UMPC
 	{"mainwin_width", "800", &prefs_common.mainwin_width, P_INT,
 	 NULL, NULL, NULL},
diff --git a/src/prefs_common.h b/src/prefs_common.h
index 37ccfe6..465a490 100644
--- a/src/prefs_common.h
+++ b/src/prefs_common.h
@@ -289,6 +289,7 @@ struct _PrefsCommon
 	gint mainwin_height;
 	gint mainwin_maximised;
 	gint mainwin_fullscreen;
+	gint mainwin_menubar;
 
 	gint msgwin_width;
 	gint msgwin_height;

-----------------------------------------------------------------------


hooks/post-receive
-- 
Claws Mail


More information about the Commits mailing list