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.
This commit is contained in:
Adrien Plazas 2020-01-16 13:28:13 +01:00 committed by Julian Sparber
parent da9ed07512
commit a1f74d24ff
4 changed files with 0 additions and 72 deletions

View file

@ -21,24 +21,6 @@
<description>The last recorded height of the application window.</description> <description>The last recorded height of the application window.</description>
</key> </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"> <key name="folder-list-pane-horizontal" type="b">
<default>true</default> <default>true</default>
<summary>Orientation of the folder list pane</summary> <summary>Orientation of the folder list pane</summary>
@ -51,12 +33,6 @@
<description>True if the formatting toolbar in the composer is shown.</description> <description>True if the formatting toolbar in the composer is shown.</description>
</key> </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"> <key name="autoselect" type="b">
<default>true</default> <default>true</default>
<summary>Autoselect next message</summary> <summary>Autoselect next message</summary>

View file

@ -20,11 +20,7 @@ public class Application.Configuration : Geary.BaseObject {
public const string CONVERSATION_VIEWER_ZOOM_KEY = "conversation-viewer-zoom"; public const string CONVERSATION_VIEWER_ZOOM_KEY = "conversation-viewer-zoom";
public const string DISPLAY_PREVIEW_KEY = "display-preview"; 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_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 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 OPTIONAL_PLUGINS = "optional-plugins";
public const string SEARCH_STRATEGY_KEY = "search-strategy"; public const string SEARCH_STRATEGY_KEY = "search-strategy";
public const string SINGLE_KEY_SHORTCUTS = "single-key-shortcuts"; 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); } 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 { public bool folder_list_pane_horizontal {
get { return settings.get_boolean(FOLDER_LIST_PANE_HORIZONTAL_KEY); } 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); } 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 { public bool autoselect {
get { return settings.get_boolean(AUTOSELECT_KEY); } get { return settings.get_boolean(AUTOSELECT_KEY); }
} }

View file

@ -1130,15 +1130,10 @@ public class Application.MainWindow :
// This code both loads AND saves the pane positions with live updating. This is more // 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 // resilient against crashes because the value in dconf changes *immediately*, and
// stays saved in the event of a crash. // 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_WIDTH_KEY, this, "window-width");
config.bind(Configuration.WINDOW_HEIGHT_KEY, this, "window-height"); config.bind(Configuration.WINDOW_HEIGHT_KEY, this, "window-height");
config.bind(Configuration.WINDOW_MAXIMIZE_KEY, this, "window-maximized"); config.bind(Configuration.WINDOW_MAXIMIZE_KEY, this, "window-maximized");
// Update to layout // 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[ config.settings.changed[
Configuration.FOLDER_LIST_PANE_HORIZONTAL_KEY Configuration.FOLDER_LIST_PANE_HORIZONTAL_KEY
].connect(on_change_orientation); ].connect(on_change_orientation);
@ -1655,23 +1650,11 @@ public class Application.MainWindow :
this.folder_paned.orientation = horizontal ? Gtk.Orientation.HORIZONTAL : this.folder_paned.orientation = horizontal ? Gtk.Orientation.HORIZONTAL :
Gtk.Orientation.VERTICAL; Gtk.Orientation.VERTICAL;
int folder_list_width =
this.application.config.folder_list_pane_position_horizontal;
if (horizontal) { if (horizontal) {
if (!initial)
this.conversations_paned.position += folder_list_width;
this.folder_box.pack_start(status_bar, false, false); this.folder_box.pack_start(status_bar, false, false);
} else { } else {
if (!initial)
this.conversations_paned.position -= folder_list_width;
this.conversation_list_box.pack_start(status_bar, false, false); 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() { private void update_headerbar() {

View file

@ -59,15 +59,6 @@ public class MainToolbar : Gtk.Box {
public MainToolbar(Application.Configuration config) { 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) { if (config.desktop_environment != UNITY) {
this.bind_property("account", this.folder_header, "title", BindingFlags.SYNC_CREATE); this.bind_property("account", this.folder_header, "title", BindingFlags.SYNC_CREATE);
this.bind_property("folder", this.folder_header, "subtitle", BindingFlags.SYNC_CREATE); this.bind_property("folder", this.folder_header, "subtitle", BindingFlags.SYNC_CREATE);