SF.net SVN: geany: [1505] trunk

eht16 at users.sourceforge.net eht16 at xxxxx
Fri May 4 16:59:00 UTC 2007


Revision: 1505
          http://svn.sourceforge.net/geany/?rev=1505&view=rev
Author:   eht16
Date:     2007-05-04 09:59:00 -0700 (Fri, 04 May 2007)

Log Message:
-----------
Added keybinding to show and hide all additional widgets(statusbar, toolbar, sidebar and messages window).

Modified Paths:
--------------
    trunk/ChangeLog
    trunk/doc/geany.docbook
    trunk/src/keybindings.c
    trunk/src/keybindings.h
    trunk/src/prefs.c
    trunk/src/ui_utils.c
    trunk/src/ui_utils.h

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2007-05-04 15:41:38 UTC (rev 1504)
+++ trunk/ChangeLog	2007-05-04 16:59:00 UTC (rev 1505)
@@ -3,6 +3,10 @@
  * doc/geany.docbook, src/main.c, src/prefs.c:
    Set widget names for the main widgets to allow users to define custom
    styles in .gtkrc-2.0.
+ * doc/geany.docbook, src/keybindings.c, src/keybindings.h, src/prefs.c,
+   src/ui_utils.c, src/ui_utils.h:
+   Added keybinding to show and hide all additional widgets(statusbar,
+   toolbar, sidebar and messages window).
 
 
 2007-05-03  Nick Treleaven  <nick.treleaven at btinternet.com>

Modified: trunk/doc/geany.docbook
===================================================================
--- trunk/doc/geany.docbook	2007-05-04 15:41:38 UTC (rev 1504)
+++ trunk/doc/geany.docbook	2007-05-04 16:59:00 UTC (rev 1505)
@@ -1713,6 +1713,11 @@
 								<entry>Shows or hides the sidebar.</entry>
 							</row>
 							<row>
+								<entry>Hide and show all additional widgets</entry>
+								<entry>Hide and show all additional widgets like the sidebar, the
+									   toolbar, the messages window and the statusbar.</entry>
+							</row>
+							<row>
 								<entry>Zoom In</entry>
 								<entry>Zooms in the text</entry>
 							</row>

Modified: trunk/src/keybindings.c
===================================================================
--- trunk/src/keybindings.c	2007-05-04 15:41:38 UTC (rev 1504)
+++ trunk/src/keybindings.c	2007-05-04 16:59:00 UTC (rev 1505)
@@ -94,6 +94,7 @@
 static void cb_func_switch_tabright(guint key_id);
 static void cb_func_switch_tablastused(guint key_id);
 static void cb_func_toggle_sidebar(guint key_id);
+static void cb_func_hide_show_all(guint key_id);
 
 // common function for editing keybindings, only valid when scintilla has focus.
 static void cb_func_edit(guint key_id);
@@ -171,6 +172,8 @@
 		0, 0, "menu_messagewindow", _("Toggle Messages Window"));
 	keys[GEANY_KEYS_MENU_SIDEBAR] = fill(cb_func_toggle_sidebar,
 		0, 0, "toggle_sidebar", _("Toggle Sidebar"));
+	keys[GEANY_KEYS_MENU_HIDESHOWALL] = fill(cb_func_hide_show_all,
+		0, 0, "hide_show_all", _("Hide and show all additional widgets"));
 	keys[GEANY_KEYS_MENU_ZOOMIN] = fill(cb_func_menu_zoomin,
 		GDK_plus, GDK_CONTROL_MASK, "menu_zoomin", _("Zoom In"));
 	keys[GEANY_KEYS_MENU_ZOOMOUT] = fill(cb_func_menu_zoomout,
@@ -1002,6 +1005,44 @@
 }
 
 
+static void cb_func_hide_show_all(G_GNUC_UNUSED guint key_id)
+{
+	static gint hide_all = FALSE;
+	GtkCheckMenuItem *msgw = GTK_CHECK_MENU_ITEM(lookup_widget(app->window, "menu_show_messages_window1"));
+	GtkCheckMenuItem *toolbari = GTK_CHECK_MENU_ITEM(lookup_widget(app->window, "menu_show_toolbar1"));
+
+	hide_all = ! hide_all;
+
+	if (hide_all)
+	{
+		if (gtk_check_menu_item_get_active(msgw))
+			gtk_check_menu_item_set_active(msgw, ! gtk_check_menu_item_get_active(msgw));
+
+		if (app->sidebar_visible)
+			cb_func_toggle_sidebar(key_id);
+
+		ui_statusbar_showhide(FALSE);
+
+		if (gtk_check_menu_item_get_active(toolbari))
+			gtk_check_menu_item_set_active(toolbari, ! gtk_check_menu_item_get_active(toolbari));
+	}
+	else
+	{
+
+		if (! gtk_check_menu_item_get_active(msgw))
+			gtk_check_menu_item_set_active(msgw, ! gtk_check_menu_item_get_active(msgw));
+
+		if (! app->sidebar_visible)
+			cb_func_toggle_sidebar(key_id);
+
+		ui_statusbar_showhide(TRUE);
+
+		if (! gtk_check_menu_item_get_active(toolbari))
+			gtk_check_menu_item_set_active(toolbari, ! gtk_check_menu_item_get_active(toolbari));
+	}
+}
+
+
 static void goto_matching_brace(gint idx)
 {
 	gint pos, new_pos;

Modified: trunk/src/keybindings.h
===================================================================
--- trunk/src/keybindings.h	2007-05-04 15:41:38 UTC (rev 1504)
+++ trunk/src/keybindings.h	2007-05-04 16:59:00 UTC (rev 1505)
@@ -80,6 +80,7 @@
 	GEANY_KEYS_MENU_SIDEBAR,
 	GEANY_KEYS_MENU_ZOOMIN,
 	GEANY_KEYS_MENU_ZOOMOUT,
+	GEANY_KEYS_MENU_HIDESHOWALL,
 
 	GEANY_KEYS_MENU_REPLACETABS,
 	GEANY_KEYS_MENU_FOLDALL,

Modified: trunk/src/prefs.c
===================================================================
--- trunk/src/prefs.c	2007-05-04 15:41:38 UTC (rev 1504)
+++ trunk/src/prefs.c	2007-05-04 16:59:00 UTC (rev 1505)
@@ -685,19 +685,12 @@
 #endif
 
 		// apply the changes made
+		ui_statusbar_showhide(app->statusbar_visible);
 		ui_update_toolbar_items();
 		ui_update_toolbar_icons(app->toolbar_icon_size);
 		gtk_toolbar_set_style(GTK_TOOLBAR(app->toolbar), app->toolbar_icon_style);
 		ui_treeviews_show_hide(FALSE);
 		gtk_notebook_set_show_tabs(GTK_NOTEBOOK(app->notebook), app->show_notebook_tabs);
-		// handle statusbar visibility
-		if (app->statusbar_visible)
-		{
-			gtk_widget_show(app->statusbar);
-			ui_update_statusbar(-1, -1);
-		}
-		else
-			gtk_widget_hide(app->statusbar);
 
 		gtk_notebook_set_tab_pos(GTK_NOTEBOOK(app->notebook), app->tab_pos_editor);
 		gtk_notebook_set_tab_pos(GTK_NOTEBOOK(msgwindow.notebook), app->tab_pos_msgwin);

Modified: trunk/src/ui_utils.c
===================================================================
--- trunk/src/ui_utils.c	2007-05-04 15:41:38 UTC (rev 1504)
+++ trunk/src/ui_utils.c	2007-05-04 16:59:00 UTC (rev 1505)
@@ -1212,4 +1212,14 @@
 	gtk_widget_destroy(dialog);
 }
 
-
+void ui_statusbar_showhide(gboolean state)
+{
+	// handle statusbar visibility
+	if (state)
+	{
+		gtk_widget_show(app->statusbar);
+		ui_update_statusbar(-1, -1);
+	}
+	else
+		gtk_widget_hide(app->statusbar);
+}

Modified: trunk/src/ui_utils.h
===================================================================
--- trunk/src/ui_utils.h	2007-05-04 15:41:38 UTC (rev 1504)
+++ trunk/src/ui_utils.h	2007-05-04 16:59:00 UTC (rev 1505)
@@ -115,4 +115,6 @@
 
 void ui_widget_modify_font_from_string(GtkWidget *wid, const gchar *str);
 
+void ui_statusbar_showhide(gboolean state);
+
 #endif


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.



More information about the Commits mailing list