]> spindle.queued.net Git - midori/commitdiff
Add hidden setting for close buttons on the left
authorChristian Dywan <christian@twotoasts.de>
Thu, 17 Feb 2011 19:55:12 +0000 (20:55 +0100)
committerChristian Dywan <christian@twotoasts.de>
Thu, 17 Feb 2011 19:57:57 +0000 (20:57 +0100)
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
midori/midori-websettings.c

index efa013b8c89094e7787711cc6f09c70fcb698d5d..8d0ca855634890541734b426ce0630074e6de67d 100644 (file)
@@ -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)
index f36e1697b7cbf8f89f73bd5b6cc1146058c0ecfb..4e5ee10e4cc63559b8d36353fbab8c3f653ae2a2 100644 (file)
@@ -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;