]> spindle.queued.net Git - midori/commitdiff
Findbar should honor close-buttons-left value
authorChristian Dywan <christian@twotoasts.de>
Wed, 12 Oct 2011 23:51:14 +0000 (01:51 +0200)
committerChristian Dywan <christian@twotoasts.de>
Thu, 13 Oct 2011 16:31:50 +0000 (18:31 +0200)
midori/midori-browser.c
toolbars/midori-findbar.c
toolbars/midori-findbar.h

index 0643d781c027d7808dab181140cb6930b17be519..ed2b5b0008221de6c2716c13c9b166afa0ce90ff 100644 (file)
@@ -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);
index 86828bf5238b72767049d3273b1e09cc6bbc5ff2..4b4a3a824cec244aa4521fdb4cfffaa19945f699 100644 (file)
@@ -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);
+}
 
index e74691c87243280866009a4c185fbd92dab01baa..e5871732f0d91e4344d3f2d9cea5a7ea9f95d941 100644 (file)
@@ -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__ */