]> spindle.queued.net Git - midori/commitdiff
Flip the toolbar of the panel as well when aligning it to the right
authorChristian Dywan <christian@twotoasts.de>
Sun, 22 Feb 2009 15:03:08 +0000 (16:03 +0100)
committerChristian Dywan <christian@twotoasts.de>
Sun, 22 Feb 2009 15:03:08 +0000 (16:03 +0100)
midori/midori-browser.c
midori/midori-panel.c
midori/midori-panel.h

index ecae06972110d84ca20cb335f2da15b05fcdbc2e..2ce320c70ddc41a213e2f3b187e940a5fc745af3 100644 (file)
@@ -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);
index 7f4a914b34cabc47c81d5eedcb7371f06c6188f7..667a82957110489d9fe627e857a3e1ea9d1ba397 100644 (file)
@@ -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)
index 40caeee1b630d02c30c7a01c6e7e17539e2c1a66..704fd95eaeb0f62030851c808f33ead4b102c480 100644 (file)
@@ -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);