hey it looks like I could've done this easier because of how box packing works in gtk+.. here's how it would be patched (a little easier):
@@ -479,7 +479,7 @@
/* we need to adjust the packing flags for the menubar to expand it if it is alone in the
* hbox and not expand it if the toolbar is appended */
gtk_box_set_child_packing(GTK_BOX(hbox_menubar), menubar,
- ! toolbar_prefs.visible || ! toolbar_prefs.append_to_menu, TRUE, 0, GTK_PACK_START);
+ ! toolbar_prefs.append_to_menu, ! toolbar_prefs.append_to_menu, 0, GTK_PACK_START);
}
or if it has already been patched...:
@@ -479,7 +479,7 @@
/* we need to adjust the packing flags for the menubar to expand it if it is alone in the
* hbox and not expand it if the toolbar is appended */
gtk_box_set_child_packing(GTK_BOX(hbox_menubar), menubar,
- ! toolbar_prefs.visible || ! toolbar_prefs.append_to_menu, TRUE, 0, GTK_PACK_START);
+ ! toolbar_prefs.visible || ! toolbar_prefs.append_to_menu, ! toolbar_prefs.visible || ! toolbar_prefs.append_to_menu, 0, GTK_PACK_START);
}
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I know this is closed... but I thought of a (very slightly) easier way to do this. If you scroll to see the 'fill' property here http://developer.gnome.org/gtk3/stable/GtkBox.html#gtk-box-set-child-packing you'll see it's dependent on what 'expand' is (Whether the child should receive extra space >when the parent grows.<). I can't attach patches because this is closed... but this should work as well as the last one:
diff --git a/src/toolbar.c b/src/toolbar.c
index 00d38a4..658c3bc 100644
--- a/src/toolbar.c
+++ b/src/toolbar.c
@@ -482,8 +482,7 @@ void toolbar_update_ui(void)
/* we need to adjust the packing flags for the menubar to expand it if it is alone in the
* hbox and not expand it if the toolbar is appended */
gtk_box_set_child_packing(GTK_BOX(hbox_menubar), menubar,
- ! (toolbar_prefs.visible && toolbar_prefs.append_to_menu),
- ! (toolbar_prefs.visible && toolbar_prefs.append_to_menu), 0, GTK_PACK_START);
+ ! (toolbar_prefs.visible && toolbar_prefs.append_to_menu), TRUE, 0, GTK_PACK_START);
}
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
This fixed it as far as I know
Now fixed in SVN, thanks for the report!
Just a note for posting patches, please use the unified patch format (diff -u), it is a lot easier to use :)
hey it looks like I could've done this easier because of how box packing works in gtk+.. here's how it would be patched (a little easier):
@@ -479,7 +479,7 @@
/* we need to adjust the packing flags for the menubar to expand it if it is alone in the
* hbox and not expand it if the toolbar is appended */
gtk_box_set_child_packing(GTK_BOX(hbox_menubar), menubar,
- ! toolbar_prefs.visible || ! toolbar_prefs.append_to_menu, TRUE, 0, GTK_PACK_START);
+ ! toolbar_prefs.append_to_menu, ! toolbar_prefs.append_to_menu, 0, GTK_PACK_START);
}
or if it has already been patched...:
@@ -479,7 +479,7 @@
/* we need to adjust the packing flags for the menubar to expand it if it is alone in the
* hbox and not expand it if the toolbar is appended */
gtk_box_set_child_packing(GTK_BOX(hbox_menubar), menubar,
- ! toolbar_prefs.visible || ! toolbar_prefs.append_to_menu, TRUE, 0, GTK_PACK_START);
+ ! toolbar_prefs.visible || ! toolbar_prefs.append_to_menu, ! toolbar_prefs.visible || ! toolbar_prefs.append_to_menu, 0, GTK_PACK_START);
}
I know this is closed... but I thought of a (very slightly) easier way to do this. If you scroll to see the 'fill' property here http://developer.gnome.org/gtk3/stable/GtkBox.html#gtk-box-set-child-packing you'll see it's dependent on what 'expand' is (Whether the child should receive extra space >when the parent grows.<). I can't attach patches because this is closed... but this should work as well as the last one:
diff --git a/src/toolbar.c b/src/toolbar.c
index 00d38a4..658c3bc 100644
--- a/src/toolbar.c
+++ b/src/toolbar.c
@@ -482,8 +482,7 @@ void toolbar_update_ui(void)
/* we need to adjust the packing flags for the menubar to expand it if it is alone in the
* hbox and not expand it if the toolbar is appended */
gtk_box_set_child_packing(GTK_BOX(hbox_menubar), menubar,
- ! (toolbar_prefs.visible && toolbar_prefs.append_to_menu),
- ! (toolbar_prefs.visible && toolbar_prefs.append_to_menu), 0, GTK_PACK_START);
+ ! (toolbar_prefs.visible && toolbar_prefs.append_to_menu), TRUE, 0, GTK_PACK_START);
}
pull request for this change here: https://github.com/geany/geany/pull/6
Edit: pull request is actually here: https://github.com/geany/geany/pull/4