From: Christian Dywan Date: Sun, 22 Feb 2009 15:03:08 +0000 (+0100) Subject: Flip the toolbar of the panel as well when aligning it to the right X-Git-Url: https://spindle.queued.net/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=30729676db03c6a2330abd15070ca49de1b7f60a;p=midori Flip the toolbar of the panel as well when aligning it to the right --- diff --git a/midori/midori-browser.c b/midori/midori-browser.c index ecae0697..2ce320c7 100644 --- a/midori/midori-browser.c +++ b/midori/midori-browser.c @@ -3975,6 +3975,8 @@ _midori_browser_update_settings (MidoriBrowser* browser) } g_object_unref (browser->panel); g_object_unref (vpaned); + midori_panel_set_right_aligned (MIDORI_PANEL (browser->panel), + right_align_sidepanel); gtk_paned_set_position (GTK_PANED (gtk_widget_get_parent (browser->panel)), last_panel_position); midori_panel_set_current_page (MIDORI_PANEL (browser->panel), last_panel_page); diff --git a/midori/midori-panel.c b/midori/midori-panel.c index 7f4a914b..667a8295 100644 --- a/midori/midori-panel.c +++ b/midori/midori-panel.c @@ -322,6 +322,27 @@ midori_panel_set_compact (MidoriPanel* panel, compact ? GTK_TOOLBAR_ICONS : GTK_TOOLBAR_BOTH); } +/** + * midori_panel_set_right_aligned: + * @compact: %TRUE if the panel should be aligned to the right + * + * Determines if the panel should be right aligned. + * + * Since: 0.1.3 + **/ +void +midori_panel_set_right_aligned (MidoriPanel* panel, + gboolean right_aligned) +{ + GtkWidget* box; + + g_return_if_fail (MIDORI_IS_PANEL (panel)); + + box = gtk_widget_get_parent (panel->toolbar); + gtk_box_reorder_child (GTK_BOX (box), panel->toolbar, + right_aligned ? -1 : 0); +} + static void midori_panel_menu_item_activate_cb (GtkWidget* widget, MidoriPanel* panel) diff --git a/midori/midori-panel.h b/midori/midori-panel.h index 40caeee1..704fd95e 100644 --- a/midori/midori-panel.h +++ b/midori/midori-panel.h @@ -46,6 +46,10 @@ void midori_panel_set_compact (MidoriPanel* panel, gboolean compact); +void +midori_panel_set_right_aligned (MidoriPanel* panel, + gboolean right_aligned); + gint midori_panel_append_page (MidoriPanel* panel, MidoriViewable* viewable);