[Xfce4-commits] <midori:master> Findbar should honor close-buttons-left value

Christian Dywan noreply at xfce.org
Thu Oct 13 18:34:02 CEST 2011


Updating branch refs/heads/master
         to eda8ac68f9fd72f88b332ed86f3c5aff1eede2b0 (commit)
       from edb01a11f65339773330fd447f20c675c22aa651 (commit)

commit eda8ac68f9fd72f88b332ed86f3c5aff1eede2b0
Author: Christian Dywan <christian at twotoasts.de>
Date:   Thu Oct 13 01:51:14 2011 +0200

    Findbar should honor close-buttons-left value

 midori/midori-browser.c   |    8 ++++++++
 toolbars/midori-findbar.c |   15 +++++++++++----
 toolbars/midori-findbar.h |    4 ++++
 3 files changed, 23 insertions(+), 4 deletions(-)

diff --git a/midori/midori-browser.c b/midori/midori-browser.c
index 0643d78..ed2b5b0 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 86828bf..4b4a3a8 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 e74691c..e587173 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__ */


More information about the Xfce4-commits mailing list