Revision: 1511 http://svn.sourceforge.net/geany/?rev=1511&view=rev Author: eht16 Date: 2007-05-06 07:49:51 -0700 (Sun, 06 May 2007)
Log Message: ----------- Added menu item to hide or show all additional widgets and renamed keybinding to menu_toggleall.
Modified Paths: -------------- trunk/doc/geany.docbook trunk/geany.glade trunk/src/callbacks.c trunk/src/callbacks.h trunk/src/interface.c trunk/src/keybindings.c trunk/src/keybindings.h
Modified: trunk/doc/geany.docbook =================================================================== --- trunk/doc/geany.docbook 2007-05-06 14:05:43 UTC (rev 1510) +++ trunk/doc/geany.docbook 2007-05-06 14:49:51 UTC (rev 1511) @@ -1760,7 +1760,7 @@ <entry>Shows or hides the sidebar.</entry> </row> <row> - <entry>Hide and show all additional widgets</entry> + <entry>Toggle all additional widgets</entry> <entry>Hide and show all additional widgets like the sidebar, the toolbar, the messages window and the statusbar.</entry> </row>
Modified: trunk/geany.glade =================================================================== --- trunk/geany.glade 2007-05-06 14:05:43 UTC (rev 1510) +++ trunk/geany.glade 2007-05-06 14:49:51 UTC (rev 1511) @@ -57,7 +57,7 @@ <property name="use_underline">True</property>
<child internal-child="image"> - <widget class="GtkImage" id="image1724"> + <widget class="GtkImage" id="image1758"> <property name="visible">True</property> <property name="stock">gtk-new</property> <property name="icon_size">1</property> @@ -147,7 +147,7 @@ <signal name="activate" handler="on_save_all1_activate" last_modification_time="Thu, 02 Jun 2005 14:15:30 GMT"/>
<child internal-child="image"> - <widget class="GtkImage" id="image1725"> + <widget class="GtkImage" id="image1759"> <property name="visible">True</property> <property name="stock">gtk-save</property> <property name="icon_size">1</property> @@ -168,7 +168,7 @@ <signal name="activate" handler="on_toolbutton23_clicked" last_modification_time="Mon, 24 Jul 2006 19:26:04 GMT"/>
<child internal-child="image"> - <widget class="GtkImage" id="image1726"> + <widget class="GtkImage" id="image1760"> <property name="visible">True</property> <property name="stock">gtk-revert-to-saved</property> <property name="icon_size">1</property> @@ -188,7 +188,7 @@ <property name="use_underline">True</property>
<child internal-child="image"> - <widget class="GtkImage" id="image1727"> + <widget class="GtkImage" id="image1761"> <property name="visible">True</property> <property name="stock">gtk-revert-to-saved</property> <property name="icon_size">1</property> @@ -284,7 +284,7 @@ <signal name="activate" handler="on_close_all1_activate" last_modification_time="Thu, 02 Jun 2005 14:15:30 GMT"/>
<child internal-child="image"> - <widget class="GtkImage" id="image1728"> + <widget class="GtkImage" id="image1762"> <property name="visible">True</property> <property name="stock">gtk-close</property> <property name="icon_size">1</property> @@ -492,7 +492,7 @@ <signal name="activate" handler="on_menu_increase_indent1_activate" last_modification_time="Tue, 01 Aug 2006 10:28:54 GMT"/>
<child internal-child="image"> - <widget class="GtkImage" id="image1729"> + <widget class="GtkImage" id="image1763"> <property name="visible">True</property> <property name="stock">gtk-indent</property> <property name="icon_size">1</property> @@ -513,7 +513,7 @@ <signal name="activate" handler="on_menu_decrease_indent1_activate" last_modification_time="Tue, 01 Aug 2006 10:28:54 GMT"/>
<child internal-child="image"> - <widget class="GtkImage" id="image1730"> + <widget class="GtkImage" id="image1764"> <property name="visible">True</property> <property name="stock">gtk-unindent</property> <property name="icon_size">1</property> @@ -569,7 +569,7 @@ <property name="use_underline">True</property>
<child internal-child="image"> - <widget class="GtkImage" id="image1731"> + <widget class="GtkImage" id="image1765"> <property name="visible">True</property> <property name="stock">gtk-add</property> <property name="icon_size">1</property> @@ -601,7 +601,7 @@ <property name="use_underline">True</property>
<child internal-child="image"> - <widget class="GtkImage" id="image1732"> + <widget class="GtkImage" id="image1766"> <property name="visible">True</property> <property name="stock">gtk-add</property> <property name="icon_size">1</property> @@ -686,7 +686,7 @@ <property name="use_underline">True</property>
<child internal-child="image"> - <widget class="GtkImage" id="image1733"> + <widget class="GtkImage" id="image1767"> <property name="visible">True</property> <property name="stock">gtk-add</property> <property name="icon_size">1</property> @@ -783,7 +783,7 @@ <signal name="activate" handler="on_replace1_activate" last_modification_time="Sun, 23 Oct 2005 13:22:36 GMT"/>
<child internal-child="image"> - <widget class="GtkImage" id="image1734"> + <widget class="GtkImage" id="image1768"> <property name="visible">True</property> <property name="stock">gtk-find-and-replace</property> <property name="icon_size">1</property> @@ -849,7 +849,7 @@ <signal name="activate" handler="on_go_to_line1_activate" last_modification_time="Tue, 23 May 2006 17:10:49 GMT"/>
<child internal-child="image"> - <widget class="GtkImage" id="image1735"> + <widget class="GtkImage" id="image1769"> <property name="visible">True</property> <property name="stock">gtk-jump-to</property> <property name="icon_size">1</property> @@ -884,7 +884,7 @@ <signal name="activate" handler="on_change_font1_activate" last_modification_time="Fri, 22 Apr 2005 18:58:45 GMT"/>
<child internal-child="image"> - <widget class="GtkImage" id="image1736"> + <widget class="GtkImage" id="image1770"> <property name="visible">True</property> <property name="stock">gtk-select-font</property> <property name="icon_size">1</property> @@ -904,6 +904,15 @@ </child>
<child> + <widget class="GtkMenuItem" id="menu_toggle_all_additional_widgets1"> + <property name="visible">True</property> + <property name="label" translatable="yes">Toggle all additional widgets</property> + <property name="use_underline">True</property> + <signal name="activate" handler="on_menu_toggle_all_additional_widgets1_activate" last_modification_time="Sun, 06 May 2007 14:13:10 GMT"/> + </widget> + </child> + + <child> <widget class="GtkCheckMenuItem" id="menu_fullscreen1"> <property name="visible">True</property> <property name="label" translatable="yes">Full_screen</property> @@ -1115,7 +1124,7 @@ <property name="visible">True</property> <property name="label" translatable="yes">Convert and Set to _CR/LF (Win)</property> <property name="use_underline">True</property> - <property name="active">False</property> + <property name="active">True</property> <signal name="activate" handler="on_crlf_activate" last_modification_time="Thu, 28 Apr 2005 16:27:24 GMT"/> </widget> </child> @@ -1125,7 +1134,7 @@ <property name="visible">True</property> <property name="label" translatable="yes">Convert and Set to _LF (Unix)</property> <property name="use_underline">True</property> - <property name="active">False</property> + <property name="active">True</property> <property name="group">crlf</property> <signal name="activate" handler="on_lf_activate" last_modification_time="Thu, 28 Apr 2005 16:27:24 GMT"/> </widget> @@ -1235,7 +1244,7 @@ <signal name="activate" handler="on_project_new1_activate" last_modification_time="Thu, 18 Jan 2007 22:16:24 GMT"/>
<child internal-child="image"> - <widget class="GtkImage" id="image1737"> + <widget class="GtkImage" id="image1771"> <property name="visible">True</property> <property name="stock">gtk-new</property> <property name="icon_size">1</property> @@ -1256,7 +1265,7 @@ <signal name="activate" handler="on_project_open1_activate" last_modification_time="Mon, 15 Jan 2007 17:34:17 GMT"/>
<child internal-child="image"> - <widget class="GtkImage" id="image1738"> + <widget class="GtkImage" id="image1772"> <property name="visible">True</property> <property name="stock">gtk-open</property> <property name="icon_size">1</property> @@ -1277,7 +1286,7 @@ <signal name="activate" handler="on_project_close1_activate" last_modification_time="Mon, 15 Jan 2007 17:34:17 GMT"/>
<child internal-child="image"> - <widget class="GtkImage" id="image1739"> + <widget class="GtkImage" id="image1773"> <property name="visible">True</property> <property name="stock">gtk-close</property> <property name="icon_size">1</property> @@ -1335,7 +1344,7 @@ <signal name="activate" handler="on_show_color_chooser1_activate" last_modification_time="Wed, 22 Jun 2005 18:10:21 GMT"/>
<child internal-child="image"> - <widget class="GtkImage" id="image1740"> + <widget class="GtkImage" id="image1774"> <property name="visible">True</property> <property name="stock">gtk-select-color</property> <property name="icon_size">1</property>
Modified: trunk/src/callbacks.c =================================================================== --- trunk/src/callbacks.c 2007-05-06 14:05:43 UTC (rev 1510) +++ trunk/src/callbacks.c 2007-05-06 14:49:51 UTC (rev 1511) @@ -1766,15 +1766,27 @@ on_menu_show_sidebar1_toggled (GtkCheckMenuItem *checkmenuitem, gpointer user_data) { + static gint active_page = -1; + if (app->ignore_callback) return;
+ if (app->sidebar_visible) + { + // to remember the active page because GTK (e.g. 2.8.18) doesn't do it and shows always + // the last page (for unknown reason, with GTK 2.6.4 it works) + active_page = gtk_notebook_get_current_page(GTK_NOTEBOOK(app->treeview_notebook)); + } + app->sidebar_visible = ! app->sidebar_visible; - if (! app->sidebar_openfiles_visible && ! app->sidebar_symbol_visible) + + if ((! app->sidebar_openfiles_visible && ! app->sidebar_symbol_visible)) { + app->sidebar_openfiles_visible = TRUE; app->sidebar_symbol_visible = TRUE; - app->sidebar_openfiles_visible = TRUE; } + ui_treeviews_show_hide(TRUE); + gtk_notebook_set_current_page(GTK_NOTEBOOK(app->treeview_notebook), active_page); }
@@ -2141,3 +2153,57 @@ g_free(command); }
+ +void +on_menu_toggle_all_additional_widgets1_activate + (GtkMenuItem *menuitem, + gpointer user_data) +{ + static gint hide_all = -1; + 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")); + + // get the initial state (necessary if Geany was closed with hide_all = TRUE) + if (hide_all == -1) + { + if (! gtk_check_menu_item_get_active(msgw) && + ! app->sidebar_visible && + ! gtk_check_menu_item_get_active(toolbari)) + { + hide_all = TRUE; + } + else + hide_all = FALSE; + } + + hide_all = ! hide_all; // toggle + + 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) + on_menu_show_sidebar1_toggled(NULL, NULL); + + 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) + on_menu_show_sidebar1_toggled(NULL, NULL); + + 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)); + } +} +
Modified: trunk/src/callbacks.h =================================================================== --- trunk/src/callbacks.h 2007-05-06 14:05:43 UTC (rev 1510) +++ trunk/src/callbacks.h 2007-05-06 14:49:51 UTC (rev 1511) @@ -603,3 +603,8 @@ void on_context_action1_activate (GtkMenuItem *menuitem, gpointer user_data); + +void +on_menu_toggle_all_additional_widgets1_activate + (GtkMenuItem *menuitem, + gpointer user_data);
Modified: trunk/src/interface.c =================================================================== --- trunk/src/interface.c 2007-05-06 14:05:43 UTC (rev 1510) +++ trunk/src/interface.c 2007-05-06 14:49:51 UTC (rev 1511) @@ -37,7 +37,7 @@ GtkWidget *menuitem1_menu; GtkWidget *menu_new1; GtkWidget *menu_new_with_template1; - GtkWidget *image1724; + GtkWidget *image1758; GtkWidget *menu_new_with_template1_menu; GtkWidget *invisible2; GtkWidget *separator12; @@ -48,11 +48,11 @@ GtkWidget *menu_save1; GtkWidget *menu_save_as1; GtkWidget *menu_save_all1; - GtkWidget *image1725; + GtkWidget *image1759; GtkWidget *menu_reload1; - GtkWidget *image1726; + GtkWidget *image1760; GtkWidget *menu_reload_as1; - GtkWidget *image1727; + GtkWidget *image1761; GtkWidget *menu_reload_as1_menu; GtkWidget *invisible7; GtkWidget *separator21; @@ -64,7 +64,7 @@ GtkWidget *separator14; GtkWidget *menu_close1; GtkWidget *menu_close_all1; - GtkWidget *image1728; + GtkWidget *image1762; GtkWidget *menu_separatormenuitem1; GtkWidget *menu_quit1; GtkWidget *edit1; @@ -90,20 +90,20 @@ GtkWidget *menu_duplicate_line1; GtkWidget *separator29; GtkWidget *menu_increase_indent1; - GtkWidget *image1729; + GtkWidget *image1763; GtkWidget *menu_decrease_indent1; - GtkWidget *image1730; + GtkWidget *image1764; GtkWidget *separator37; GtkWidget *send_selection_to2; GtkWidget *send_selection_to2_menu; GtkWidget *invisible13; GtkWidget *separator18; GtkWidget *insert_include2; - GtkWidget *image1731; + GtkWidget *image1765; GtkWidget *insert_include2_menu; GtkWidget *invisible4; GtkWidget *add_comments1; - GtkWidget *image1732; + GtkWidget *image1766; GtkWidget *add_comments1_menu; GtkWidget *menu_add_changelog_entry1; GtkWidget *insert_file_header1; @@ -112,7 +112,7 @@ GtkWidget *insert_gpl_notice2; GtkWidget *insert_bsd_license_notice2; GtkWidget *insert_date1; - GtkWidget *image1733; + GtkWidget *image1767; GtkWidget *insert_date1_menu; GtkWidget *invisible8; GtkWidget *separator9; @@ -124,7 +124,7 @@ GtkWidget *find_previous1; GtkWidget *find_in_files1; GtkWidget *replace1; - GtkWidget *image1734; + GtkWidget *image1768; GtkWidget *separator33; GtkWidget *find_nextsel1; GtkWidget *find_prevsel1; @@ -132,12 +132,13 @@ GtkWidget *next_message1; GtkWidget *separator32; GtkWidget *go_to_line1; - GtkWidget *image1735; + GtkWidget *image1769; GtkWidget *menuitem3; GtkWidget *menuitem3_menu; GtkWidget *menu_change_font1; - GtkWidget *image1736; + GtkWidget *image1770; GtkWidget *menu_separator4; + GtkWidget *menu_toggle_all_additional_widgets1; GtkWidget *menu_fullscreen1; GtkWidget *menu_show_messages_window1; GtkWidget *menu_show_toolbar1; @@ -178,18 +179,18 @@ GtkWidget *menu_project1; GtkWidget *menu_project1_menu; GtkWidget *project_new1; - GtkWidget *image1737; + GtkWidget *image1771; GtkWidget *project_open1; - GtkWidget *image1738; + GtkWidget *image1772; GtkWidget *project_close1; - GtkWidget *image1739; + GtkWidget *image1773; GtkWidget *separator34; GtkWidget *project_properties1; GtkWidget *menu_build1; GtkWidget *tools1; GtkWidget *tools1_menu; GtkWidget *menu_choose_color1; - GtkWidget *image1740; + GtkWidget *image1774; GtkWidget *menu_count_words1; GtkWidget *menu_insert_special_chars1; GtkWidget *menu_item5; @@ -290,9 +291,9 @@ gtk_widget_show (menu_new_with_template1); gtk_container_add (GTK_CONTAINER (menuitem1_menu), menu_new_with_template1);
- image1724 = gtk_image_new_from_stock ("gtk-new", GTK_ICON_SIZE_MENU); - gtk_widget_show (image1724); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_new_with_template1), image1724); + image1758 = gtk_image_new_from_stock ("gtk-new", GTK_ICON_SIZE_MENU); + gtk_widget_show (image1758); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_new_with_template1), image1758);
menu_new_with_template1_menu = gtk_menu_new (); gtk_menu_item_set_submenu (GTK_MENU_ITEM (menu_new_with_template1), menu_new_with_template1_menu); @@ -335,25 +336,25 @@ gtk_container_add (GTK_CONTAINER (menuitem1_menu), menu_save_all1); gtk_tooltips_set_tip (tooltips, menu_save_all1, _("Saves all open files"), NULL);
- image1725 = gtk_image_new_from_stock ("gtk-save", GTK_ICON_SIZE_MENU); - gtk_widget_show (image1725); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_save_all1), image1725); + image1759 = gtk_image_new_from_stock ("gtk-save", GTK_ICON_SIZE_MENU); + gtk_widget_show (image1759); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_save_all1), image1759);
menu_reload1 = gtk_image_menu_item_new_with_mnemonic (_("_Reload")); gtk_widget_show (menu_reload1); gtk_container_add (GTK_CONTAINER (menuitem1_menu), menu_reload1);
- image1726 = gtk_image_new_from_stock ("gtk-revert-to-saved", GTK_ICON_SIZE_MENU); - gtk_widget_show (image1726); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_reload1), image1726); + image1760 = gtk_image_new_from_stock ("gtk-revert-to-saved", GTK_ICON_SIZE_MENU); + gtk_widget_show (image1760); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_reload1), image1760);
menu_reload_as1 = gtk_image_menu_item_new_with_mnemonic (_("R_eload As")); gtk_widget_show (menu_reload_as1); gtk_container_add (GTK_CONTAINER (menuitem1_menu), menu_reload_as1);
- image1727 = gtk_image_new_from_stock ("gtk-revert-to-saved", GTK_ICON_SIZE_MENU); - gtk_widget_show (image1727); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_reload_as1), image1727); + image1761 = gtk_image_new_from_stock ("gtk-revert-to-saved", GTK_ICON_SIZE_MENU); + gtk_widget_show (image1761); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_reload_as1), image1761);
menu_reload_as1_menu = gtk_menu_new (); gtk_menu_item_set_submenu (GTK_MENU_ITEM (menu_reload_as1), menu_reload_as1_menu); @@ -404,9 +405,9 @@ gtk_container_add (GTK_CONTAINER (menuitem1_menu), menu_close_all1); gtk_tooltips_set_tip (tooltips, menu_close_all1, _("Closes all open files"), NULL);
- image1728 = gtk_image_new_from_stock ("gtk-close", GTK_ICON_SIZE_MENU); - gtk_widget_show (image1728); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_close_all1), image1728); + image1762 = gtk_image_new_from_stock ("gtk-close", GTK_ICON_SIZE_MENU); + gtk_widget_show (image1762); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_close_all1), image1762);
menu_separatormenuitem1 = gtk_separator_menu_item_new (); gtk_widget_show (menu_separatormenuitem1); @@ -514,17 +515,17 @@ gtk_widget_show (menu_increase_indent1); gtk_container_add (GTK_CONTAINER (menu_format1_menu), menu_increase_indent1);
- image1729 = gtk_image_new_from_stock ("gtk-indent", GTK_ICON_SIZE_MENU); - gtk_widget_show (image1729); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_increase_indent1), image1729); + image1763 = gtk_image_new_from_stock ("gtk-indent", GTK_ICON_SIZE_MENU); + gtk_widget_show (image1763); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_increase_indent1), image1763);
menu_decrease_indent1 = gtk_image_menu_item_new_with_mnemonic (_("_Decrease Indent")); gtk_widget_show (menu_decrease_indent1); gtk_container_add (GTK_CONTAINER (menu_format1_menu), menu_decrease_indent1);
- image1730 = gtk_image_new_from_stock ("gtk-unindent", GTK_ICON_SIZE_MENU); - gtk_widget_show (image1730); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_decrease_indent1), image1730); + image1764 = gtk_image_new_from_stock ("gtk-unindent", GTK_ICON_SIZE_MENU); + gtk_widget_show (image1764); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_decrease_indent1), image1764);
separator37 = gtk_separator_menu_item_new (); gtk_widget_show (separator37); @@ -550,9 +551,9 @@ gtk_widget_show (insert_include2); gtk_container_add (GTK_CONTAINER (edit1_menu), insert_include2);
- image1731 = gtk_image_new_from_stock ("gtk-add", GTK_ICON_SIZE_MENU); - gtk_widget_show (image1731); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (insert_include2), image1731); + image1765 = gtk_image_new_from_stock ("gtk-add", GTK_ICON_SIZE_MENU); + gtk_widget_show (image1765); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (insert_include2), image1765);
insert_include2_menu = gtk_menu_new (); gtk_menu_item_set_submenu (GTK_MENU_ITEM (insert_include2), insert_include2_menu); @@ -564,9 +565,9 @@ gtk_widget_show (add_comments1); gtk_container_add (GTK_CONTAINER (edit1_menu), add_comments1);
- image1732 = gtk_image_new_from_stock ("gtk-add", GTK_ICON_SIZE_MENU); - gtk_widget_show (image1732); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (add_comments1), image1732); + image1766 = gtk_image_new_from_stock ("gtk-add", GTK_ICON_SIZE_MENU); + gtk_widget_show (image1766); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (add_comments1), image1766);
add_comments1_menu = gtk_menu_new (); gtk_menu_item_set_submenu (GTK_MENU_ITEM (add_comments1), add_comments1_menu); @@ -605,9 +606,9 @@ gtk_widget_show (insert_date1); gtk_container_add (GTK_CONTAINER (edit1_menu), insert_date1);
- image1733 = gtk_image_new_from_stock ("gtk-add", GTK_ICON_SIZE_MENU); - gtk_widget_show (image1733); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (insert_date1), image1733); + image1767 = gtk_image_new_from_stock ("gtk-add", GTK_ICON_SIZE_MENU); + gtk_widget_show (image1767); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (insert_date1), image1767);
insert_date1_menu = gtk_menu_new (); gtk_menu_item_set_submenu (GTK_MENU_ITEM (insert_date1), insert_date1_menu); @@ -651,9 +652,9 @@ gtk_widget_show (replace1); gtk_container_add (GTK_CONTAINER (search1_menu), replace1);
- image1734 = gtk_image_new_from_stock ("gtk-find-and-replace", GTK_ICON_SIZE_MENU); - gtk_widget_show (image1734); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (replace1), image1734); + image1768 = gtk_image_new_from_stock ("gtk-find-and-replace", GTK_ICON_SIZE_MENU); + gtk_widget_show (image1768); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (replace1), image1768);
separator33 = gtk_separator_menu_item_new (); gtk_widget_show (separator33); @@ -686,9 +687,9 @@ gtk_widget_show (go_to_line1); gtk_container_add (GTK_CONTAINER (search1_menu), go_to_line1);
- image1735 = gtk_image_new_from_stock ("gtk-jump-to", GTK_ICON_SIZE_MENU); - gtk_widget_show (image1735); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (go_to_line1), image1735); + image1769 = gtk_image_new_from_stock ("gtk-jump-to", GTK_ICON_SIZE_MENU); + gtk_widget_show (image1769); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (go_to_line1), image1769);
menuitem3 = gtk_menu_item_new_with_mnemonic (_("_View")); gtk_widget_show (menuitem3); @@ -702,15 +703,19 @@ gtk_container_add (GTK_CONTAINER (menuitem3_menu), menu_change_font1); gtk_tooltips_set_tip (tooltips, menu_change_font1, _("Change the default font"), NULL);
- image1736 = gtk_image_new_from_stock ("gtk-select-font", GTK_ICON_SIZE_MENU); - gtk_widget_show (image1736); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_change_font1), image1736); + image1770 = gtk_image_new_from_stock ("gtk-select-font", GTK_ICON_SIZE_MENU); + gtk_widget_show (image1770); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_change_font1), image1770);
menu_separator4 = gtk_separator_menu_item_new (); gtk_widget_show (menu_separator4); gtk_container_add (GTK_CONTAINER (menuitem3_menu), menu_separator4); gtk_widget_set_sensitive (menu_separator4, FALSE);
+ menu_toggle_all_additional_widgets1 = gtk_menu_item_new_with_mnemonic (_("Toggle all additional widgets")); + gtk_widget_show (menu_toggle_all_additional_widgets1); + gtk_container_add (GTK_CONTAINER (menuitem3_menu), menu_toggle_all_additional_widgets1); + menu_fullscreen1 = gtk_check_menu_item_new_with_mnemonic (_("Full_screen")); gtk_widget_show (menu_fullscreen1); gtk_container_add (GTK_CONTAINER (menuitem3_menu), menu_fullscreen1); @@ -824,11 +829,13 @@ crlf_group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (crlf)); gtk_widget_show (crlf); gtk_container_add (GTK_CONTAINER (menu_line_endings1_menu), crlf); + gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (crlf), TRUE);
lf = gtk_radio_menu_item_new_with_mnemonic (crlf_group, _("Convert and Set to _LF (Unix)")); crlf_group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (lf)); gtk_widget_show (lf); gtk_container_add (GTK_CONTAINER (menu_line_endings1_menu), lf); + gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (lf), TRUE);
cr = gtk_radio_menu_item_new_with_mnemonic (crlf_group, _("Convert and Set to CR (_Mac)")); crlf_group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (cr)); @@ -886,25 +893,25 @@ gtk_widget_show (project_new1); gtk_container_add (GTK_CONTAINER (menu_project1_menu), project_new1);
- image1737 = gtk_image_new_from_stock ("gtk-new", GTK_ICON_SIZE_MENU); - gtk_widget_show (image1737); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (project_new1), image1737); + image1771 = gtk_image_new_from_stock ("gtk-new", GTK_ICON_SIZE_MENU); + gtk_widget_show (image1771); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (project_new1), image1771);
project_open1 = gtk_image_menu_item_new_with_mnemonic (_("_Open")); gtk_widget_show (project_open1); gtk_container_add (GTK_CONTAINER (menu_project1_menu), project_open1);
- image1738 = gtk_image_new_from_stock ("gtk-open", GTK_ICON_SIZE_MENU); - gtk_widget_show (image1738); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (project_open1), image1738); + image1772 = gtk_image_new_from_stock ("gtk-open", GTK_ICON_SIZE_MENU); + gtk_widget_show (image1772); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (project_open1), image1772);
project_close1 = gtk_image_menu_item_new_with_mnemonic (_("_Close")); gtk_widget_show (project_close1); gtk_container_add (GTK_CONTAINER (menu_project1_menu), project_close1);
- image1739 = gtk_image_new_from_stock ("gtk-close", GTK_ICON_SIZE_MENU); - gtk_widget_show (image1739); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (project_close1), image1739); + image1773 = gtk_image_new_from_stock ("gtk-close", GTK_ICON_SIZE_MENU); + gtk_widget_show (image1773); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (project_close1), image1773);
separator34 = gtk_separator_menu_item_new (); gtk_widget_show (separator34); @@ -931,9 +938,9 @@ gtk_container_add (GTK_CONTAINER (tools1_menu), menu_choose_color1); gtk_tooltips_set_tip (tooltips, menu_choose_color1, _("Open a color chooser dialog, to interactively pick colors from a palette."), NULL);
- image1740 = gtk_image_new_from_stock ("gtk-select-color", GTK_ICON_SIZE_MENU); - gtk_widget_show (image1740); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_choose_color1), image1740); + image1774 = gtk_image_new_from_stock ("gtk-select-color", GTK_ICON_SIZE_MENU); + gtk_widget_show (image1774); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_choose_color1), image1774);
menu_count_words1 = gtk_menu_item_new_with_mnemonic (_("_Word Count")); gtk_widget_show (menu_count_words1); @@ -1383,6 +1390,9 @@ g_signal_connect ((gpointer) menu_change_font1, "activate", G_CALLBACK (on_change_font1_activate), NULL); + g_signal_connect ((gpointer) menu_toggle_all_additional_widgets1, "activate", + G_CALLBACK (on_menu_toggle_all_additional_widgets1_activate), + NULL); g_signal_connect ((gpointer) menu_fullscreen1, "toggled", G_CALLBACK (on_fullscreen1_toggled), NULL); @@ -1561,7 +1571,7 @@ GLADE_HOOKUP_OBJECT (window1, menuitem1_menu, "menuitem1_menu"); GLADE_HOOKUP_OBJECT (window1, menu_new1, "menu_new1"); GLADE_HOOKUP_OBJECT (window1, menu_new_with_template1, "menu_new_with_template1"); - GLADE_HOOKUP_OBJECT (window1, image1724, "image1724"); + GLADE_HOOKUP_OBJECT (window1, image1758, "image1758"); GLADE_HOOKUP_OBJECT (window1, menu_new_with_template1_menu, "menu_new_with_template1_menu"); GLADE_HOOKUP_OBJECT (window1, invisible2, "invisible2"); GLADE_HOOKUP_OBJECT (window1, separator12, "separator12"); @@ -1572,11 +1582,11 @@ GLADE_HOOKUP_OBJECT (window1, menu_save1, "menu_save1"); GLADE_HOOKUP_OBJECT (window1, menu_save_as1, "menu_save_as1"); GLADE_HOOKUP_OBJECT (window1, menu_save_all1, "menu_save_all1"); - GLADE_HOOKUP_OBJECT (window1, image1725, "image1725"); + GLADE_HOOKUP_OBJECT (window1, image1759, "image1759"); GLADE_HOOKUP_OBJECT (window1, menu_reload1, "menu_reload1"); - GLADE_HOOKUP_OBJECT (window1, image1726, "image1726"); + GLADE_HOOKUP_OBJECT (window1, image1760, "image1760"); GLADE_HOOKUP_OBJECT (window1, menu_reload_as1, "menu_reload_as1"); - GLADE_HOOKUP_OBJECT (window1, image1727, "image1727"); + GLADE_HOOKUP_OBJECT (window1, image1761, "image1761"); GLADE_HOOKUP_OBJECT (window1, menu_reload_as1_menu, "menu_reload_as1_menu"); GLADE_HOOKUP_OBJECT (window1, invisible7, "invisible7"); GLADE_HOOKUP_OBJECT (window1, separator21, "separator21"); @@ -1588,7 +1598,7 @@ GLADE_HOOKUP_OBJECT (window1, separator14, "separator14"); GLADE_HOOKUP_OBJECT (window1, menu_close1, "menu_close1"); GLADE_HOOKUP_OBJECT (window1, menu_close_all1, "menu_close_all1"); - GLADE_HOOKUP_OBJECT (window1, image1728, "image1728"); + GLADE_HOOKUP_OBJECT (window1, image1762, "image1762"); GLADE_HOOKUP_OBJECT (window1, menu_separatormenuitem1, "menu_separatormenuitem1"); GLADE_HOOKUP_OBJECT (window1, menu_quit1, "menu_quit1"); GLADE_HOOKUP_OBJECT (window1, edit1, "edit1"); @@ -1614,20 +1624,20 @@ GLADE_HOOKUP_OBJECT (window1, menu_duplicate_line1, "menu_duplicate_line1"); GLADE_HOOKUP_OBJECT (window1, separator29, "separator29"); GLADE_HOOKUP_OBJECT (window1, menu_increase_indent1, "menu_increase_indent1"); - GLADE_HOOKUP_OBJECT (window1, image1729, "image1729"); + GLADE_HOOKUP_OBJECT (window1, image1763, "image1763"); GLADE_HOOKUP_OBJECT (window1, menu_decrease_indent1, "menu_decrease_indent1"); - GLADE_HOOKUP_OBJECT (window1, image1730, "image1730"); + GLADE_HOOKUP_OBJECT (window1, image1764, "image1764"); GLADE_HOOKUP_OBJECT (window1, separator37, "separator37"); GLADE_HOOKUP_OBJECT (window1, send_selection_to2, "send_selection_to2"); GLADE_HOOKUP_OBJECT (window1, send_selection_to2_menu, "send_selection_to2_menu"); GLADE_HOOKUP_OBJECT (window1, invisible13, "invisible13"); GLADE_HOOKUP_OBJECT (window1, separator18, "separator18"); GLADE_HOOKUP_OBJECT (window1, insert_include2, "insert_include2"); - GLADE_HOOKUP_OBJECT (window1, image1731, "image1731"); + GLADE_HOOKUP_OBJECT (window1, image1765, "image1765"); GLADE_HOOKUP_OBJECT (window1, insert_include2_menu, "insert_include2_menu"); GLADE_HOOKUP_OBJECT (window1, invisible4, "invisible4"); GLADE_HOOKUP_OBJECT (window1, add_comments1, "add_comments1"); - GLADE_HOOKUP_OBJECT (window1, image1732, "image1732"); + GLADE_HOOKUP_OBJECT (window1, image1766, "image1766"); GLADE_HOOKUP_OBJECT (window1, add_comments1_menu, "add_comments1_menu"); GLADE_HOOKUP_OBJECT (window1, menu_add_changelog_entry1, "menu_add_changelog_entry1"); GLADE_HOOKUP_OBJECT (window1, insert_file_header1, "insert_file_header1"); @@ -1636,7 +1646,7 @@ GLADE_HOOKUP_OBJECT (window1, insert_gpl_notice2, "insert_gpl_notice2"); GLADE_HOOKUP_OBJECT (window1, insert_bsd_license_notice2, "insert_bsd_license_notice2"); GLADE_HOOKUP_OBJECT (window1, insert_date1, "insert_date1"); - GLADE_HOOKUP_OBJECT (window1, image1733, "image1733"); + GLADE_HOOKUP_OBJECT (window1, image1767, "image1767"); GLADE_HOOKUP_OBJECT (window1, insert_date1_menu, "insert_date1_menu"); GLADE_HOOKUP_OBJECT (window1, invisible8, "invisible8"); GLADE_HOOKUP_OBJECT (window1, separator9, "separator9"); @@ -1648,7 +1658,7 @@ GLADE_HOOKUP_OBJECT (window1, find_previous1, "find_previous1"); GLADE_HOOKUP_OBJECT (window1, find_in_files1, "find_in_files1"); GLADE_HOOKUP_OBJECT (window1, replace1, "replace1"); - GLADE_HOOKUP_OBJECT (window1, image1734, "image1734"); + GLADE_HOOKUP_OBJECT (window1, image1768, "image1768"); GLADE_HOOKUP_OBJECT (window1, separator33, "separator33"); GLADE_HOOKUP_OBJECT (window1, find_nextsel1, "find_nextsel1"); GLADE_HOOKUP_OBJECT (window1, find_prevsel1, "find_prevsel1"); @@ -1656,12 +1666,13 @@ GLADE_HOOKUP_OBJECT (window1, next_message1, "next_message1"); GLADE_HOOKUP_OBJECT (window1, separator32, "separator32"); GLADE_HOOKUP_OBJECT (window1, go_to_line1, "go_to_line1"); - GLADE_HOOKUP_OBJECT (window1, image1735, "image1735"); + GLADE_HOOKUP_OBJECT (window1, image1769, "image1769"); GLADE_HOOKUP_OBJECT (window1, menuitem3, "menuitem3"); GLADE_HOOKUP_OBJECT (window1, menuitem3_menu, "menuitem3_menu"); GLADE_HOOKUP_OBJECT (window1, menu_change_font1, "menu_change_font1"); - GLADE_HOOKUP_OBJECT (window1, image1736, "image1736"); + GLADE_HOOKUP_OBJECT (window1, image1770, "image1770"); GLADE_HOOKUP_OBJECT (window1, menu_separator4, "menu_separator4"); + GLADE_HOOKUP_OBJECT (window1, menu_toggle_all_additional_widgets1, "menu_toggle_all_additional_widgets1"); GLADE_HOOKUP_OBJECT (window1, menu_fullscreen1, "menu_fullscreen1"); GLADE_HOOKUP_OBJECT (window1, menu_show_messages_window1, "menu_show_messages_window1"); GLADE_HOOKUP_OBJECT (window1, menu_show_toolbar1, "menu_show_toolbar1"); @@ -1701,18 +1712,18 @@ GLADE_HOOKUP_OBJECT (window1, menu_project1, "menu_project1"); GLADE_HOOKUP_OBJECT (window1, menu_project1_menu, "menu_project1_menu"); GLADE_HOOKUP_OBJECT (window1, project_new1, "project_new1"); - GLADE_HOOKUP_OBJECT (window1, image1737, "image1737"); + GLADE_HOOKUP_OBJECT (window1, image1771, "image1771"); GLADE_HOOKUP_OBJECT (window1, project_open1, "project_open1"); - GLADE_HOOKUP_OBJECT (window1, image1738, "image1738"); + GLADE_HOOKUP_OBJECT (window1, image1772, "image1772"); GLADE_HOOKUP_OBJECT (window1, project_close1, "project_close1"); - GLADE_HOOKUP_OBJECT (window1, image1739, "image1739"); + GLADE_HOOKUP_OBJECT (window1, image1773, "image1773"); GLADE_HOOKUP_OBJECT (window1, separator34, "separator34"); GLADE_HOOKUP_OBJECT (window1, project_properties1, "project_properties1"); GLADE_HOOKUP_OBJECT (window1, menu_build1, "menu_build1"); GLADE_HOOKUP_OBJECT (window1, tools1, "tools1"); GLADE_HOOKUP_OBJECT (window1, tools1_menu, "tools1_menu"); GLADE_HOOKUP_OBJECT (window1, menu_choose_color1, "menu_choose_color1"); - GLADE_HOOKUP_OBJECT (window1, image1740, "image1740"); + GLADE_HOOKUP_OBJECT (window1, image1774, "image1774"); GLADE_HOOKUP_OBJECT (window1, menu_count_words1, "menu_count_words1"); GLADE_HOOKUP_OBJECT (window1, menu_insert_special_chars1, "menu_insert_special_chars1"); GLADE_HOOKUP_OBJECT (window1, menu_item5, "menu_item5");
Modified: trunk/src/keybindings.c =================================================================== --- trunk/src/keybindings.c 2007-05-06 14:05:43 UTC (rev 1510) +++ trunk/src/keybindings.c 2007-05-06 14:49:51 UTC (rev 1511) @@ -71,6 +71,7 @@ static void cb_func_menu_nextmessage(guint key_id); static void cb_func_menu_gotoline(guint key_id);
+static void cb_func_menu_toggle_all(guint key_id); static void cb_func_menu_fullscreen(guint key_id); static void cb_func_menu_messagewindow(guint key_id); static void cb_func_menu_zoomin(guint key_id); @@ -94,7 +95,6 @@ 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); @@ -169,14 +169,14 @@ keys[GEANY_KEYS_MENU_GOTOLINE] = fill(cb_func_menu_gotoline, GDK_j, GDK_CONTROL_MASK, "menu_gotoline", _("Go to line"));
+ keys[GEANY_KEYS_MENU_TOGGLEALL] = fill(cb_func_menu_toggle_all, + 0, 0, "menu_toggleall", _("Toggle all additional widgets")); keys[GEANY_KEYS_MENU_FULLSCREEN] = fill(cb_func_menu_fullscreen, GDK_F11, 0, "menu_fullscreen", _("Fullscreen")); keys[GEANY_KEYS_MENU_MESSAGEWINDOW] = fill(cb_func_menu_messagewindow, 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, @@ -354,8 +354,10 @@ GEANY_ADD_ACCEL(GEANY_KEYS_MENU_FINDINFILES, find_in_files1); GEANY_ADD_ACCEL(GEANY_KEYS_MENU_NEXTMESSAGE, next_message1); GEANY_ADD_ACCEL(GEANY_KEYS_MENU_GOTOLINE, go_to_line1); + GEANY_ADD_ACCEL(GEANY_KEYS_MENU_TOGGLEALL, menu_toggle_all_additional_widgets1); GEANY_ADD_ACCEL(GEANY_KEYS_MENU_FULLSCREEN, menu_fullscreen1); GEANY_ADD_ACCEL(GEANY_KEYS_MENU_MESSAGEWINDOW, menu_show_messages_window1); + GEANY_ADD_ACCEL(GEANY_KEYS_MENU_SIDEBAR, menu_show_sidebar1); GEANY_ADD_ACCEL(GEANY_KEYS_MENU_OPENCOLORCHOOSER, menu_choose_color1); GEANY_ADD_ACCEL(GEANY_KEYS_MENU_ZOOMIN, menu_zoom_in1); GEANY_ADD_ACCEL(GEANY_KEYS_MENU_ZOOMOUT, menu_zoom_out1); @@ -466,7 +468,7 @@ g_string_append(text_names, _("\n<b>Search menu</b>\n")); g_string_append(text_keys, "\n\n"); break; - case GEANY_KEYS_MENU_FULLSCREEN: + case GEANY_KEYS_MENU_TOGGLEALL: g_string_append(text_names, _("\n<b>View menu</b>\n")); g_string_append(text_keys, "\n\n"); break; @@ -977,63 +979,13 @@
static void cb_func_toggle_sidebar(G_GNUC_UNUSED guint key_id) { - static gint active_page = -1; - - if (app->sidebar_visible) - { - // to remember the active page because GTK (e.g. 2.8.18) doesn't do it and shows always - // the last page (for unknown reason, with GTK 2.6.4 it works) - active_page = gtk_notebook_get_current_page(GTK_NOTEBOOK(app->treeview_notebook)); - } - - app->sidebar_visible = ! app->sidebar_visible; - - if ((! app->sidebar_openfiles_visible && ! app->sidebar_symbol_visible)) - { - app->sidebar_openfiles_visible = TRUE; - app->sidebar_symbol_visible = TRUE; - } - - ui_treeviews_show_hide(TRUE); - gtk_notebook_set_current_page(GTK_NOTEBOOK(app->treeview_notebook), active_page); + on_menu_show_sidebar1_toggled(NULL, NULL); }
-static void cb_func_hide_show_all(G_GNUC_UNUSED guint key_id) +static void cb_func_menu_toggle_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)); - } + on_menu_toggle_all_additional_widgets1_activate(NULL, NULL); }
Modified: trunk/src/keybindings.h =================================================================== --- trunk/src/keybindings.h 2007-05-06 14:05:43 UTC (rev 1510) +++ trunk/src/keybindings.h 2007-05-06 14:49:51 UTC (rev 1511) @@ -75,12 +75,12 @@ GEANY_KEYS_POPUP_GOTOTAGDECLARATION, GEANY_KEYS_POPUP_CONTEXTACTION,
+ GEANY_KEYS_MENU_TOGGLEALL, GEANY_KEYS_MENU_FULLSCREEN, GEANY_KEYS_MENU_MESSAGEWINDOW, GEANY_KEYS_MENU_SIDEBAR, GEANY_KEYS_MENU_ZOOMIN, GEANY_KEYS_MENU_ZOOMOUT, - GEANY_KEYS_MENU_HIDESHOWALL,
GEANY_KEYS_MENU_REPLACETABS, GEANY_KEYS_MENU_FOLDALL,
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.