[Xfce4-commits] <midori:master> Add hidden setting for close buttons on the left

Christian Dywan noreply at xfce.org
Thu Feb 17 21:00:02 CET 2011


Updating branch refs/heads/master
         to d19396a06575679ef7aa2d6c051bbe9e274fdb66 (commit)
       from 74549eff9d65c9c435949adc11b695cb88d4280d (commit)

commit d19396a06575679ef7aa2d6c051bbe9e274fdb66
Author: Christian Dywan <christian at twotoasts.de>
Date:   Thu Feb 17 20:55:12 2011 +0100

    Add hidden setting for close buttons on the left
    
    This value can be changed by distributions using window
    decorations on the left side.
    
    Fixes: https://bugs.launchpad.net/midori/+bug/699972

 midori/midori-view.c        |   21 ++++++++++++---------
 midori/midori-websettings.c |   29 +++++++++++++++++++++++++++++
 2 files changed, 41 insertions(+), 9 deletions(-)

diff --git a/midori/midori-view.c b/midori/midori-view.c
index efa013b..8d0ca85 100644
--- a/midori/midori-view.c
+++ b/midori/midori-view.c
@@ -4573,15 +4573,18 @@ midori_view_get_proxy_tab_label (MidoriView* view)
         align = gtk_alignment_new (1.0, 0.0, 0.0, 0.0);
         gtk_container_add (GTK_CONTAINER (align), view->tab_close);
 
-        #if HAVE_OSX
-        gtk_box_pack_end (GTK_BOX (hbox), view->tab_icon, FALSE, FALSE, 0);
-        gtk_box_pack_end (GTK_BOX (hbox), view->tab_title, FALSE, TRUE, 0);
-        gtk_box_pack_start (GTK_BOX (hbox), align, FALSE, FALSE, 0);
-        #else
-        gtk_box_pack_start (GTK_BOX (hbox), view->tab_icon, FALSE, FALSE, 0);
-        gtk_box_pack_start (GTK_BOX (hbox), view->tab_title, FALSE, TRUE, 0);
-        gtk_box_pack_end (GTK_BOX (hbox), align, FALSE, FALSE, 0);
-        #endif
+        if (katze_object_get_boolean (view->settings, "close-buttons-left"))
+        {
+            gtk_box_pack_end (GTK_BOX (hbox), view->tab_icon, FALSE, FALSE, 0);
+            gtk_box_pack_end (GTK_BOX (hbox), view->tab_title, FALSE, TRUE, 0);
+            gtk_box_pack_start (GTK_BOX (hbox), align, FALSE, FALSE, 0);
+        }
+        else
+        {
+            gtk_box_pack_start (GTK_BOX (hbox), view->tab_icon, FALSE, FALSE, 0);
+            gtk_box_pack_start (GTK_BOX (hbox), view->tab_title, FALSE, TRUE, 0);
+            gtk_box_pack_end (GTK_BOX (hbox), align, FALSE, FALSE, 0);
+        }
         gtk_widget_show_all (GTK_WIDGET (event_box));
 
         if (view->minimized)
diff --git a/midori/midori-websettings.c b/midori/midori-websettings.c
index f36e169..4e5ee10 100644
--- a/midori/midori-websettings.c
+++ b/midori/midori-websettings.c
@@ -48,6 +48,7 @@ struct _MidoriWebSettings
     MidoriPreferredEncoding preferred_encoding : 3;
     gboolean always_show_tabbar : 1;
     gboolean close_buttons_on_tabs : 1;
+    gboolean close_buttons_left : 1;
     MidoriNewPage open_new_pages_in : 2;
     MidoriNewPage open_external_pages_in : 2;
     gboolean middle_click_opens_selection : 1;
@@ -134,6 +135,7 @@ enum
 
     PROP_ALWAYS_SHOW_TABBAR,
     PROP_CLOSE_BUTTONS_ON_TABS,
+    PROP_CLOSE_BUTTONS_LEFT,
     PROP_OPEN_NEW_PAGES_IN,
     PROP_OPEN_EXTERNAL_PAGES_IN,
     PROP_MIDDLE_CLICK_OPENS_SELECTION,
@@ -730,6 +732,27 @@ midori_web_settings_class_init (MidoriWebSettingsClass* class)
                                      TRUE,
                                      flags));
 
+    /**
+     * MidoriWebSettings:close-buttons-left:
+     *
+     * Whether to show close buttons on the left side.
+     *
+     * Since: 0.3.1
+     */
+    g_object_class_install_property (gobject_class,
+                                     PROP_CLOSE_BUTTONS_LEFT,
+                                     g_param_spec_boolean (
+                                     "close-buttons-left",
+                                     "Close buttons on the left",
+                                     "Whether to show close buttons on the left side",
+                                     #if HAVE_OSX
+                                     TRUE,
+                                     #else
+                                     FALSE,
+                                     #endif
+                                     flags));
+
+
     g_object_class_install_property (gobject_class,
                                      PROP_OPEN_NEW_PAGES_IN,
                                      g_param_spec_enum (
@@ -1353,6 +1376,9 @@ midori_web_settings_set_property (GObject*      object,
     case PROP_CLOSE_BUTTONS_ON_TABS:
         web_settings->close_buttons_on_tabs = g_value_get_boolean (value);
         break;
+    case PROP_CLOSE_BUTTONS_LEFT:
+        web_settings->close_buttons_left = g_value_get_boolean (value);
+        break;
     case PROP_OPEN_NEW_PAGES_IN:
         web_settings->open_new_pages_in = g_value_get_enum (value);
         break;
@@ -1599,6 +1625,9 @@ midori_web_settings_get_property (GObject*    object,
     case PROP_CLOSE_BUTTONS_ON_TABS:
         g_value_set_boolean (value, web_settings->close_buttons_on_tabs);
         break;
+    case PROP_CLOSE_BUTTONS_LEFT:
+        g_value_set_boolean (value, web_settings->close_buttons_left);
+        break;
     case PROP_OPEN_NEW_PAGES_IN:
         g_value_set_enum (value, web_settings->open_new_pages_in);
         break;



More information about the Xfce4-commits mailing list