Commit 74c2a389 authored by Paolo Bacchilega's avatar Paolo Bacchilega
Browse files

header bar: align menus to the right for menu buttons on the right side

parent e616a61b
......@@ -45,6 +45,7 @@ export_tools__gth_browser_construct_cb (GthBrowser *browser)
button = _gtk_menu_button_new_for_header_bar ("export-symbolic");
gtk_widget_set_tooltip_text (button, _("Export"));
gtk_menu_button_set_menu_model (GTK_MENU_BUTTON (button), menu);
gtk_widget_set_halign (GTK_WIDGET (gtk_menu_button_get_popup (GTK_MENU_BUTTON (button))), GTK_ALIGN_CENTER);
gtk_widget_show (button);
gtk_box_pack_start (GTK_BOX (gth_browser_get_headerbar_section (browser, GTH_BROWSER_HEADER_SECTION_BROWSER_TOOLS)), button, FALSE, FALSE, 0);
}
......@@ -173,6 +173,7 @@ list_tools__gth_browser_construct_cb (GthBrowser *browser)
g_signal_connect (button, "toggled", G_CALLBACK (tools_menu_button_toggled_cb), data);
gtk_widget_set_tooltip_text (button, _("Tools"));
gtk_menu_button_set_menu_model (GTK_MENU_BUTTON (button), menu);
gtk_widget_set_halign (GTK_WIDGET (gtk_menu_button_get_popup (GTK_MENU_BUTTON (button))), GTK_ALIGN_CENTER);
gtk_widget_show (button);
gtk_box_pack_start (GTK_BOX (gth_browser_get_headerbar_section (browser, GTH_BROWSER_HEADER_SECTION_BROWSER_TOOLS)), button, FALSE, FALSE, 0);
......@@ -182,6 +183,7 @@ list_tools__gth_browser_construct_cb (GthBrowser *browser)
g_signal_connect (button, "toggled", G_CALLBACK (tools_menu_button_toggled_cb), data);
gtk_widget_set_tooltip_text (button, _("Tools"));
gtk_menu_button_set_menu_model (GTK_MENU_BUTTON (button), menu);
gtk_widget_set_halign (GTK_WIDGET (gtk_menu_button_get_popup (GTK_MENU_BUTTON (button))), GTK_ALIGN_CENTER);
gtk_widget_show (button);
gtk_box_pack_end (GTK_BOX (gth_browser_get_headerbar_section (browser, GTH_BROWSER_HEADER_SECTION_VIEWER_EDIT)), button, FALSE, FALSE, 0);
......
......@@ -4509,9 +4509,9 @@ gth_browser_init (GthBrowser *browser)
builder = _gtk_builder_new_from_resource ("gears-menu.ui");
menu = G_MENU_MODEL (gtk_builder_get_object (builder, "menu"));
browser->priv->menu_button = _gtk_menu_button_new_for_header_bar (NULL);
gtk_menu_button_set_direction (GTK_MENU_BUTTON (browser->priv->menu_button), GTK_ARROW_NONE);
browser->priv->menu_button = _gtk_menu_button_new_for_header_bar ("open-menu-symbolic");
gtk_menu_button_set_menu_model (GTK_MENU_BUTTON (browser->priv->menu_button), menu);
gtk_widget_set_halign (GTK_WIDGET (gtk_menu_button_get_popup (GTK_MENU_BUTTON (browser->priv->menu_button))), GTK_ALIGN_END);
gtk_widget_show_all (browser->priv->menu_button);
gtk_header_bar_pack_end (GTK_HEADER_BAR (header_bar), browser->priv->menu_button);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment