diff --git a/midori/midori-browser.c b/midori/midori-browser.c index 0643d781..ed2b5b00 100644 --- a/midori/midori-browser.c +++ b/midori/midori-browser.c @@ -6503,6 +6503,9 @@ _midori_browser_update_settings (MidoriBrowser* browser) "news-aggregator", &browser->news_aggregator, NULL); + midori_findbar_set_close_button_left (MIDORI_FINDBAR (browser->find), + katze_object_get_boolean (browser->settings, "close-buttons-left")); + if (remember_last_window_size) { if (browser->last_window_width && browser->last_window_height) @@ -6627,6 +6630,11 @@ midori_browser_settings_notify (MidoriWebSettings* web_settings, { katze_assign (browser->news_aggregator, g_value_dup_string (&value)); } + else if (name == g_intern_string ("close-buttons-left")) + { + midori_findbar_set_close_button_left (MIDORI_FINDBAR (browser->find), + g_value_get_boolean (&value)); + } else if (!g_object_class_find_property (G_OBJECT_GET_CLASS (web_settings), name)) g_warning (_("Unexpected setting '%s'"), name); diff --git a/toolbars/midori-findbar.c b/toolbars/midori-findbar.c index 86828bf5..4b4a3a82 100644 --- a/toolbars/midori-findbar.c +++ b/toolbars/midori-findbar.c @@ -324,11 +324,7 @@ midori_findbar_init (MidoriFindbar* findbar) _("Close Findbar")); g_signal_connect (findbar->find_close, "clicked", G_CALLBACK (midori_findbar_button_close_clicked_cb), findbar); - #if HAVE_OSX - gtk_toolbar_insert (GTK_TOOLBAR (findbar), findbar->find_close, 0); - #else gtk_toolbar_insert (GTK_TOOLBAR (findbar), findbar->find_close, -1); - #endif sokoke_container_show_children (GTK_CONTAINER (findbar)); } @@ -382,4 +378,15 @@ midori_findbar_search_text (MidoriFindbar* findbar, } } +void +midori_findbar_set_close_button_left (MidoriFindbar* findbar, + gboolean close_button_left) +{ + g_object_ref (findbar->find_close); + gtk_container_remove (GTK_CONTAINER (findbar), + GTK_WIDGET (findbar->find_close)); + gtk_toolbar_insert (GTK_TOOLBAR (findbar), findbar->find_close, + close_button_left ? 0 : -1); + g_object_unref (findbar->find_close); +} diff --git a/toolbars/midori-findbar.h b/toolbars/midori-findbar.h index e74691c8..e5871732 100644 --- a/toolbars/midori-findbar.h +++ b/toolbars/midori-findbar.h @@ -57,6 +57,10 @@ midori_findbar_search_text (MidoriFindbar* findbar, gboolean found, gchar* typing); +void +midori_findbar_set_close_button_left (MidoriFindbar* findbar, + gboolean close_button_left); + G_END_DECLS #endif /* __MIDORI_FINDBAR_H__ */