[geary: 1/20] Drop saving the paned width




commit a1f74d24ff11869f108dc42016a648ce45999b70
Author: Adrien Plazas <kekun plazas laposte net>
Date:   Thu Jan 16 13:28:13 2020 +0100

    Drop saving the paned width
    
    This is needed to replace GtkPaned by HdyLeaflet. This breaks syncing
    the size of the headerbar with the rest of the window, it will be fixed
    in a later commit.

 desktop/org.gnome.Geary.gschema.xml                | 24 ----------------------
 .../application/application-configuration.vala     | 22 --------------------
 .../application/application-main-window.vala       | 17 ---------------
 src/client/components/main-toolbar.vala            |  9 --------
 4 files changed, 72 deletions(-)
---
diff --git a/desktop/org.gnome.Geary.gschema.xml b/desktop/org.gnome.Geary.gschema.xml
index bbbadc36a..9850dffdb 100644
--- a/desktop/org.gnome.Geary.gschema.xml
+++ b/desktop/org.gnome.Geary.gschema.xml
@@ -21,24 +21,6 @@
         <description>The last recorded height of the application window.</description>
     </key>
 
-    <key name="folder-list-pane-position" type="i">
-        <default>100</default>
-        <summary>Position of folder list pane</summary>
-        <description>Position of the folder list Paned grabber.</description>
-    </key>
-
-    <key name="folder-list-pane-position-horizontal" type="i">
-        <default>-1</default>
-        <summary>Position of folder list pane when horizontal</summary>
-        <description>Position of the folder list Paned grabber in the horizontal orientation.</description>
-    </key>
-
-    <key name="folder-list-pane-position-vertical" type="i">
-        <default>200</default>
-        <summary>Position of folder list pane when vertical</summary>
-        <description>Position of the folder list Paned grabber in the vertical orientation.</description>
-    </key>
-
     <key name="folder-list-pane-horizontal" type="b">
         <default>true</default>
         <summary>Orientation of the folder list pane</summary>
@@ -51,12 +33,6 @@
         <description>True if the formatting toolbar in the composer is shown.</description>
     </key>
 
-    <key name="messages-pane-position" type="i">
-        <default>250</default>
-        <summary>Position of message list pane</summary>
-        <description>Position of the message list Paned grabber.</description>
-    </key>
-
     <key name="autoselect" type="b">
         <default>true</default>
         <summary>Autoselect next message</summary>
diff --git a/src/client/application/application-configuration.vala 
b/src/client/application/application-configuration.vala
index 00c359c95..51a11bbf1 100644
--- a/src/client/application/application-configuration.vala
+++ b/src/client/application/application-configuration.vala
@@ -20,11 +20,7 @@ public class Application.Configuration : Geary.BaseObject {
     public const string CONVERSATION_VIEWER_ZOOM_KEY = "conversation-viewer-zoom";
     public const string DISPLAY_PREVIEW_KEY = "display-preview";
     public const string FOLDER_LIST_PANE_HORIZONTAL_KEY = "folder-list-pane-horizontal";
-    public const string FOLDER_LIST_PANE_POSITION_HORIZONTAL_KEY = "folder-list-pane-position-horizontal";
-    public const string FOLDER_LIST_PANE_POSITION_KEY = "folder-list-pane-position";
-    public const string FOLDER_LIST_PANE_POSITION_VERTICAL_KEY = "folder-list-pane-position-vertical";
     public const string FORMATTING_TOOLBAR_VISIBLE = "formatting-toolbar-visible";
-    public const string MESSAGES_PANE_POSITION_KEY = "messages-pane-position";
     public const string OPTIONAL_PLUGINS = "optional-plugins";
     public const string SEARCH_STRATEGY_KEY = "search-strategy";
     public const string SINGLE_KEY_SHORTCUTS = "single-key-shortcuts";
@@ -90,19 +86,6 @@ public class Application.Configuration : Geary.BaseObject {
         get { return settings.get_boolean(WINDOW_MAXIMIZE_KEY); }
     }
 
-    public int folder_list_pane_position_old {
-        get { return settings.get_int(FOLDER_LIST_PANE_POSITION_KEY); }
-    }
-
-    public int folder_list_pane_position_horizontal {
-        get { return settings.get_int(FOLDER_LIST_PANE_POSITION_HORIZONTAL_KEY); }
-        set { settings.set_int(FOLDER_LIST_PANE_POSITION_HORIZONTAL_KEY, value); }
-    }
-
-    public int folder_list_pane_position_vertical {
-        get { return settings.get_int(FOLDER_LIST_PANE_POSITION_VERTICAL_KEY); }
-    }
-
     public bool folder_list_pane_horizontal {
         get { return settings.get_boolean(FOLDER_LIST_PANE_HORIZONTAL_KEY); }
     }
@@ -112,11 +95,6 @@ public class Application.Configuration : Geary.BaseObject {
         set { settings.set_boolean(FORMATTING_TOOLBAR_VISIBLE, value); }
     }
 
-    public int messages_pane_position {
-        get { return settings.get_int(MESSAGES_PANE_POSITION_KEY); }
-        set { settings.set_int(MESSAGES_PANE_POSITION_KEY, value); }
-    }
-
     public bool autoselect {
         get { return settings.get_boolean(AUTOSELECT_KEY); }
     }
diff --git a/src/client/application/application-main-window.vala 
b/src/client/application/application-main-window.vala
index 47749019a..48f8bae64 100644
--- a/src/client/application/application-main-window.vala
+++ b/src/client/application/application-main-window.vala
@@ -1130,15 +1130,10 @@ public class Application.MainWindow :
         // This code both loads AND saves the pane positions with live updating. This is more
         // resilient against crashes because the value in dconf changes *immediately*, and
         // stays saved in the event of a crash.
-        config.bind(Configuration.MESSAGES_PANE_POSITION_KEY, this.conversations_paned, "position");
         config.bind(Configuration.WINDOW_WIDTH_KEY, this, "window-width");
         config.bind(Configuration.WINDOW_HEIGHT_KEY, this, "window-height");
         config.bind(Configuration.WINDOW_MAXIMIZE_KEY, this, "window-maximized");
         // Update to layout
-        if (config.folder_list_pane_position_horizontal == -1) {
-            config.folder_list_pane_position_horizontal = config.folder_list_pane_position_old;
-            config.messages_pane_position += config.folder_list_pane_position_old;
-        }
         config.settings.changed[
             Configuration.FOLDER_LIST_PANE_HORIZONTAL_KEY
         ].connect(on_change_orientation);
@@ -1655,23 +1650,11 @@ public class Application.MainWindow :
         this.folder_paned.orientation = horizontal ? Gtk.Orientation.HORIZONTAL :
             Gtk.Orientation.VERTICAL;
 
-        int folder_list_width =
-            this.application.config.folder_list_pane_position_horizontal;
         if (horizontal) {
-            if (!initial)
-                this.conversations_paned.position += folder_list_width;
             this.folder_box.pack_start(status_bar, false, false);
         } else {
-            if (!initial)
-                this.conversations_paned.position -= folder_list_width;
             this.conversation_list_box.pack_start(status_bar, false, false);
         }
-
-        this.application.config.bind(
-            horizontal
-            ? Configuration.FOLDER_LIST_PANE_POSITION_HORIZONTAL_KEY
-            : Configuration.FOLDER_LIST_PANE_POSITION_VERTICAL_KEY,
-            this.folder_paned, "position");
     }
 
     private void update_headerbar() {
diff --git a/src/client/components/main-toolbar.vala b/src/client/components/main-toolbar.vala
index 31f87df6c..aa263253f 100644
--- a/src/client/components/main-toolbar.vala
+++ b/src/client/components/main-toolbar.vala
@@ -59,15 +59,6 @@ public class MainToolbar : Gtk.Box {
 
 
     public MainToolbar(Application.Configuration config) {
-        // Sync headerbar width with left pane
-        config.bind(
-            Application.Configuration.MESSAGES_PANE_POSITION_KEY,
-            this,
-            "left-pane-width",
-            SettingsBindFlags.GET
-        );
-        this.bind_property("left-pane-width", this.folder_header, "width-request", BindingFlags.SYNC_CREATE);
-
         if (config.desktop_environment != UNITY) {
             this.bind_property("account", this.folder_header, "title", BindingFlags.SYNC_CREATE);
             this.bind_property("folder", this.folder_header, "subtitle", BindingFlags.SYNC_CREATE);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]