"& ui_prefs.fullscreen" was redundant, state brings "ui_prefs.fullscreen &
interface_prefs.hide_menubar_on_fullscreen" from caller. Now with tabs..I
think it's ok!

On Sat, Oct 22, 2011 at 6:03 PM, Dimitar Zhekov <[email protected]>wrote:

> On Thu, 20 Oct 2011 12:43:15 +0100
> Pedro Cirne <[email protected]> wrote:
>
> > Here it is...I hope it's useful!
> >
> > On Thu, Oct 20, 2011 at 1:55 AM, Lex Trotman <[email protected]> wrote:
> >
> > > On 20 October 2011 11:39, Pedro Cirne <[email protected]> wrote:
> > > > I have edited the source code to make it works for me, is it useful
> for
> > > the
> > > > project?
> > >
> > > If you submit a patch/pull request we will certainly have a look at
> > > it.  Then you may not have to keep applying it each time Geany
> > > upgrades.
>
> Looks fine to me, except that some of the changes are indented with
> spaces instead of tabs.
>
> I'm not quite sure why ui_menubar_showhide() should take a gboolean
> state, check it with & and hide the menu for state = 1 (or TRUE?). It
> may be the most effective way, but writing an extra line or too to make
> the code stupid and simple may be a good idea.
>
> A good thing to have, though I personnaly am not going to use it.
>
> --
> E-gards: Jimmy
> _______________________________________________
> Geany mailing list
> [email protected]
> https://lists.uvena.de/cgi-bin/mailman/listinfo/geany
>
Only in geany_r6018_hide_top_bars_on_fullscreen/: aclocal.m4
Only in geany_r6018_hide_top_bars_on_fullscreen/: autom4te.cache
Only in geany_r6018_hide_top_bars_on_fullscreen/: build-aux
Only in geany_r6018_hide_top_bars_on_fullscreen/: config.h.in
Only in geany_r6018_hide_top_bars_on_fullscreen/: configure
Only in geany_r6018_hide_top_bars_on_fullscreen/doc: Makefile.in
diff -crB '--exclude=.svn' geany/geany.glade geany_r6018_hide_top_bars_on_fullscreen/geany.glade
*** geany/geany.glade	2011-10-20 12:24:03.000000000 +0100
--- geany_r6018_hide_top_bars_on_fullscreen/geany.glade	2011-10-20 01:48:25.000000000 +0100
***************
*** 4588,4593 ****
--- 4588,4612 ----
  				  <property name="fill">False</property>
  				</packing>
  			      </child>
+ 			      <child>
+ 				<widget class="GtkCheckButton" id="check_menubar_fullscreen_visible">
+ 				  <property name="visible">True</property>
+ 				  <property name="tooltip" translatable="yes">Whether to show the top bars at the top of the main window on fullscreen mode</property>
+ 				  <property name="can_focus">True</property>
+ 				  <property name="label" translatable="yes">Hide top bars on fullscreen</property>
+ 				  <property name="use_underline">True</property>
+ 				  <property name="relief">GTK_RELIEF_NORMAL</property>
+ 				  <property name="focus_on_click">True</property>
+ 				  <property name="active">True</property>
+ 				  <property name="inconsistent">False</property>
+ 				  <property name="draw_indicator">True</property>
+ 				</widget>
+ 				<packing>
+ 				  <property name="padding">0</property>
+ 				  <property name="expand">False</property>
+ 				  <property name="fill">False</property>
+ 				</packing>
+ 			      </child>
  			    </widget>
  			  </child>
  			</widget>
Only in geany_r6018_hide_top_bars_on_fullscreen/: geany_r6018_hide_top_bars_on_fullscreen.patch
Only in geany_r6018_hide_top_bars_on_fullscreen/icons/16x16: Makefile.in
Only in geany_r6018_hide_top_bars_on_fullscreen/icons/48x48: Makefile.in
Only in geany_r6018_hide_top_bars_on_fullscreen/icons: Makefile.in
Only in geany_r6018_hide_top_bars_on_fullscreen/icons/scalable: Makefile.in
Only in geany_r6018_hide_top_bars_on_fullscreen/: intltool-extract.in
Only in geany_r6018_hide_top_bars_on_fullscreen/: intltool-merge.in
Only in geany_r6018_hide_top_bars_on_fullscreen/: intltool-update.in
Only in geany_r6018_hide_top_bars_on_fullscreen/m4: intltool.m4
Only in geany_r6018_hide_top_bars_on_fullscreen/m4: libtool.m4
Only in geany_r6018_hide_top_bars_on_fullscreen/m4: lt~obsolete.m4
Only in geany_r6018_hide_top_bars_on_fullscreen/m4: ltoptions.m4
Only in geany_r6018_hide_top_bars_on_fullscreen/m4: ltsugar.m4
Only in geany_r6018_hide_top_bars_on_fullscreen/m4: ltversion.m4
Only in geany_r6018_hide_top_bars_on_fullscreen/: Makefile.in
Only in geany_r6018_hide_top_bars_on_fullscreen/plugins: Makefile.in
Only in geany_r6018_hide_top_bars_on_fullscreen/po: Makefile.in.in
Only in geany_r6018_hide_top_bars_on_fullscreen/scintilla/include: Makefile.in
Only in geany_r6018_hide_top_bars_on_fullscreen/scintilla: Makefile.in
diff -crB '--exclude=.svn' geany/src/callbacks.c geany_r6018_hide_top_bars_on_fullscreen/src/callbacks.c
*** geany/src/callbacks.c	2011-10-20 12:23:57.000000000 +0100
--- geany_r6018_hide_top_bars_on_fullscreen/src/callbacks.c	2011-10-22 23:05:55.222515588 +0100
***************
*** 1951,1956 ****
--- 1951,1958 ----
  		ui_prefs.fullscreen = (event->new_window_state & GDK_WINDOW_STATE_FULLSCREEN) ? TRUE : FALSE;
  		gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menuitem), ui_prefs.fullscreen);
  
+ 		ui_menubar_showhide(ui_prefs.fullscreen & interface_prefs.hide_menubar_on_fullscreen);
+ 
  		ignore_callback = FALSE;
  	}
  	return FALSE;
diff -crB '--exclude=.svn' geany/src/interface.c geany_r6018_hide_top_bars_on_fullscreen/src/interface.c
*** geany/src/interface.c	2011-10-20 12:23:57.000000000 +0100
--- geany_r6018_hide_top_bars_on_fullscreen/src/interface.c	2011-10-20 12:16:31.000000000 +0100
***************
*** 2617,2622 ****
--- 2617,2623 ----
    GtkWidget *alignment26;
    GtkWidget *vbox22;
    GtkWidget *check_statusbar_visible;
+   GtkWidget *check_menubar_fullscreen_visible;
    GtkWidget *label187;
    GtkWidget *label248;
    GtkWidget *vbox54;
***************
*** 3411,3416 ****
--- 3412,3424 ----
    gtk_widget_show (check_statusbar_visible);
    gtk_box_pack_start (GTK_BOX (vbox22), check_statusbar_visible, FALSE, FALSE, 0);
    gtk_tooltips_set_tip (tooltips, check_statusbar_visible, _("Whether to show the status bar at the bottom of the main window"), NULL);
+     
+     
+   check_menubar_fullscreen_visible = gtk_check_button_new_with_mnemonic (_("Hide top bars on fullscreen"));
+   gtk_widget_show (check_menubar_fullscreen_visible);
+   gtk_box_pack_start (GTK_BOX (vbox22), check_menubar_fullscreen_visible, FALSE, FALSE, 0);
+   gtk_tooltips_set_tip (tooltips, check_menubar_fullscreen_visible, _("Whether to show the top bars at the top of the main window on fullscreen mode"), NULL);
+ 
  
    label187 = gtk_label_new (_("<b>Miscellaneous</b>"));
    gtk_widget_show (label187);
***************
*** 5227,5232 ****
--- 5235,5241 ----
    GLADE_HOOKUP_OBJECT (prefs_dialog, alignment26, "alignment26");
    GLADE_HOOKUP_OBJECT (prefs_dialog, vbox22, "vbox22");
    GLADE_HOOKUP_OBJECT (prefs_dialog, check_statusbar_visible, "check_statusbar_visible");
+   GLADE_HOOKUP_OBJECT (prefs_dialog, check_menubar_fullscreen_visible, "check_menubar_fullscreen_visible");
    GLADE_HOOKUP_OBJECT (prefs_dialog, label187, "label187");
    GLADE_HOOKUP_OBJECT (prefs_dialog, label248, "label248");
    GLADE_HOOKUP_OBJECT (prefs_dialog, vbox54, "vbox54");
diff -crB '--exclude=.svn' geany/src/keyfile.c geany_r6018_hide_top_bars_on_fullscreen/src/keyfile.c
*** geany/src/keyfile.c	2011-10-20 12:23:57.000000000 +0100
--- geany_r6018_hide_top_bars_on_fullscreen/src/keyfile.c	2011-10-22 23:04:44.312899736 +0100
***************
*** 525,530 ****
--- 525,531 ----
  {
  	g_key_file_set_boolean(config, PACKAGE, "sidebar_visible", ui_prefs.sidebar_visible);
  	g_key_file_set_boolean(config, PACKAGE, "statusbar_visible", interface_prefs.statusbar_visible);
+ 	g_key_file_set_boolean(config, PACKAGE, "menubar_fullscreen_visible", interface_prefs.hide_menubar_on_fullscreen);
  	g_key_file_set_boolean(config, PACKAGE, "msgwindow_visible", ui_prefs.msgwindow_visible);
  	g_key_file_set_boolean(config, PACKAGE, "fullscreen", ui_prefs.fullscreen);
  
***************
*** 900,905 ****
--- 901,907 ----
  	GError *error = NULL;
  
  	ui_prefs.sidebar_visible = utils_get_setting_boolean(config, PACKAGE, "sidebar_visible", TRUE);
+ 	interface_prefs.hide_menubar_on_fullscreen= utils_get_setting_boolean(config, PACKAGE, "menubar_fullscreen_visible", TRUE );
  	ui_prefs.msgwindow_visible = utils_get_setting_boolean(config, PACKAGE, "msgwindow_visible", TRUE);
  	ui_prefs.fullscreen = utils_get_setting_boolean(config, PACKAGE, "fullscreen", FALSE);
  	ui_prefs.custom_date_format = utils_get_setting_string(config, PACKAGE, "custom_date_format", "");
diff -crB '--exclude=.svn' geany/src/main.c geany_r6018_hide_top_bars_on_fullscreen/src/main.c
*** geany/src/main.c	2011-10-20 12:23:57.000000000 +0100
--- geany_r6018_hide_top_bars_on_fullscreen/src/main.c	2011-10-22 23:04:01.246466381 +0100
***************
*** 200,205 ****
--- 200,212 ----
  	{
  		gtk_widget_hide(ui_widgets.statusbar);
  	}
+     
+     /* hide menubar if desired */
+ 	if (ui_prefs.fullscreen & interface_prefs.hide_menubar_on_fullscreen)
+ 	{
+ 		gtk_widget_hide(main_widgets.hbox_menubar);
+ 	}
+     
  
  	/* set the tab placements of the notebooks */
  	gtk_notebook_set_tab_pos(GTK_NOTEBOOK(main_widgets.notebook), interface_prefs.tab_pos_editor);
***************
*** 256,261 ****
--- 263,269 ----
  	main_widgets.notebook = ui_lookup_widget(main_widgets.window, "notebook1");
  	main_widgets.editor_menu = create_edit_menu1();
  	main_widgets.tools_menu = ui_lookup_widget(main_widgets.window, "tools1_menu");
+ 	main_widgets.hbox_menubar=ui_lookup_widget(main_widgets.window, "hbox_menubar");
  	main_widgets.message_window_notebook = ui_lookup_widget(main_widgets.window, "notebook_info");
  	main_widgets.project_menu = ui_lookup_widget(main_widgets.window, "menu_project1_menu");
  
Only in geany_r6018_hide_top_bars_on_fullscreen/src: Makefile.in
diff -crB '--exclude=.svn' geany/src/prefs.c geany_r6018_hide_top_bars_on_fullscreen/src/prefs.c
*** geany/src/prefs.c	2011-10-20 12:23:57.000000000 +0100
--- geany_r6018_hide_top_bars_on_fullscreen/src/prefs.c	2011-10-22 23:07:48.671900979 +0100
***************
*** 451,456 ****
--- 451,459 ----
  
  	widget = ui_lookup_widget(ui_widgets.prefs_dialog, "check_statusbar_visible");
  	gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget), interface_prefs.statusbar_visible);
+     
+ 	widget = ui_lookup_widget(ui_widgets.prefs_dialog, "check_menubar_fullscreen_visible");
+ 	gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget), interface_prefs.hide_menubar_on_fullscreen);
  
  
  	/* Toolbar settings */
***************
*** 913,919 ****
  
  		widget = ui_lookup_widget(ui_widgets.prefs_dialog, "check_statusbar_visible");
  		interface_prefs.statusbar_visible = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget));
! 
  
  		/* Toolbar settings */
  		widget = ui_lookup_widget(ui_widgets.prefs_dialog, "check_toolbar_show");
--- 916,924 ----
  
  		widget = ui_lookup_widget(ui_widgets.prefs_dialog, "check_statusbar_visible");
  		interface_prefs.statusbar_visible = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget));
!         
! 		widget = ui_lookup_widget(ui_widgets.prefs_dialog, "check_menubar_fullscreen_visible");
! 		interface_prefs.hide_menubar_on_fullscreen = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget));
  
  		/* Toolbar settings */
  		widget = ui_lookup_widget(ui_widgets.prefs_dialog, "check_toolbar_show");
***************
*** 1214,1219 ****
--- 1219,1225 ----
  
  		/* apply the changes made */
  		ui_statusbar_showhide(interface_prefs.statusbar_visible);
+ 		ui_menubar_showhide(ui_prefs.fullscreen & interface_prefs.hide_menubar_on_fullscreen);
  		sidebar_openfiles_update_all(); /* to update if full path setting has changed */
  		toolbar_apply_settings();
  		toolbar_update_ui();
diff -crB '--exclude=.svn' geany/src/ui_utils.c geany_r6018_hide_top_bars_on_fullscreen/src/ui_utils.c
*** geany/src/ui_utils.c	2011-10-20 12:23:57.000000000 +0100
--- geany_r6018_hide_top_bars_on_fullscreen/src/ui_utils.c	2011-10-22 23:08:14.665093494 +0100
***************
*** 1831,1836 ****
--- 1831,1847 ----
  		gtk_widget_hide(ui_widgets.statusbar);
  }
  
+ void ui_menubar_showhide(gboolean state)
+ {
+ 	/* handle menubar visibility */
+ 	if (state)
+ 	{
+ 		gtk_widget_hide(main_widgets.hbox_menubar);
+ 	}
+ 	else
+ 		gtk_widget_show(main_widgets.hbox_menubar);
+ }
+ 
  
  /** Packs all @c GtkWidgets passed after the row argument into a table, using
   * one widget per cell. The first widget is not expanded as the table grows,
diff -crB '--exclude=.svn' geany/src/ui_utils.h geany_r6018_hide_top_bars_on_fullscreen/src/ui_utils.h
*** geany/src/ui_utils.h	2011-10-20 12:23:57.000000000 +0100
--- geany_r6018_hide_top_bars_on_fullscreen/src/ui_utils.h	2011-10-22 23:08:31.671668028 +0100
***************
*** 50,55 ****
--- 50,56 ----
  	gint			tab_pos_msgwin;				/**< positions of message window's tabs */
  	gint			tab_pos_sidebar;			/**< positions of sidebar's tabs */
  	gboolean		statusbar_visible;			/**< whether the status bar is visible */
+ 	gboolean		hide_menubar_on_fullscreen;
  	gboolean		show_symbol_list_expanders;	/**< whether to show expanders in the symbol list */
  	/** whether a double click on notebook tabs hides all other windows */
  	gboolean		notebook_double_click_hides_widgets;
***************
*** 79,84 ****
--- 80,86 ----
  	GtkWidget	*notebook;			/**< Document notebook. */
  	GtkWidget	*editor_menu;		/**< Popup editor menu. */
  	GtkWidget	*tools_menu;		/**< Most plugins add menu items to the Tools menu. */
+ 	GtkWidget	*hbox_menubar;
  	/** Progress bar widget in the status bar to show progress of various actions.
  	 * See ui_progress_bar_start() for details. */
  	GtkWidget	*progressbar;
Only in geany_r6018_hide_top_bars_on_fullscreen/tagmanager/include: Makefile.in
Only in geany_r6018_hide_top_bars_on_fullscreen/tagmanager: Makefile.in
Only in geany_r6018_hide_top_bars_on_fullscreen/tagmanager/mio: Makefile.in
_______________________________________________
Geany mailing list
[email protected]
https://lists.uvena.de/cgi-bin/mailman/listinfo/geany

Reply via email to