#4130 remember paned grabber positions
This commit is contained in:
parent
fb54fb1847
commit
98f3ef7e00
3 changed files with 33 additions and 3 deletions
|
|
@ -26,6 +26,18 @@ public class Configuration {
|
|||
set { settings.set_boolean(WINDOW_MAXIMIZE_NAME, value); }
|
||||
}
|
||||
|
||||
private const string FOLDER_LIST_PANE_POSITION_NAME = "folder-list-pane-position";
|
||||
public int folder_list_pane_position {
|
||||
get { return settings.get_int(FOLDER_LIST_PANE_POSITION_NAME); }
|
||||
set { settings.set_int(FOLDER_LIST_PANE_POSITION_NAME, value); }
|
||||
}
|
||||
|
||||
private const string MESSAGES_PANE_POSITION_NAME = "messages-pane-position";
|
||||
public int messages_pane_position {
|
||||
get { return settings.get_int(MESSAGES_PANE_POSITION_NAME); }
|
||||
set { settings.set_int(MESSAGES_PANE_POSITION_NAME, value); }
|
||||
}
|
||||
|
||||
// Creates a configuration object.
|
||||
// is_installed: set to true if installed, else false.
|
||||
// schema_dir: MUST be set if not installed. Directory where GSettings schema is located.
|
||||
|
|
|
|||
|
|
@ -20,6 +20,18 @@
|
|||
<description>The last recorded height of the application window.</description>
|
||||
</key>
|
||||
|
||||
<key name="folder-list-pane-position" type="i">
|
||||
<default>-1</default>
|
||||
<summary>position of folder list pane</summary>
|
||||
<description>Position of the folder list HPaned grabber. -1 means unset.</description>
|
||||
</key>
|
||||
|
||||
<key name="messages-pane-position" type="i">
|
||||
<default>-1</default>
|
||||
<summary>position of message list pane</summary>
|
||||
<description>Position of the message list HPaned grabber. -1 means unset.</description>
|
||||
</key>
|
||||
|
||||
</schema>
|
||||
|
||||
</schemalist>
|
||||
|
|
|
|||
|
|
@ -33,6 +33,8 @@ public class MainWindow : Gtk.Window {
|
|||
private int window_width;
|
||||
private int window_height;
|
||||
private bool window_maximized;
|
||||
private Gtk.HPaned folder_paned = new Gtk.HPaned();
|
||||
private Gtk.HPaned messages_paned = new Gtk.HPaned();
|
||||
|
||||
public MainWindow() {
|
||||
title = GearyApplication.NAME;
|
||||
|
|
@ -107,6 +109,9 @@ public class MainWindow : Gtk.Window {
|
|||
if (GearyApplication.instance.config.window_maximize)
|
||||
maximize();
|
||||
|
||||
folder_paned.set_position(GearyApplication.instance.config.folder_list_pane_position);
|
||||
messages_paned.set_position(GearyApplication.instance.config.messages_pane_position);
|
||||
|
||||
base.show_all();
|
||||
}
|
||||
|
||||
|
|
@ -116,6 +121,10 @@ public class MainWindow : Gtk.Window {
|
|||
GearyApplication.instance.config.window_height = window_height;
|
||||
GearyApplication.instance.config.window_maximize = window_maximized;
|
||||
|
||||
// Save pane positions.
|
||||
GearyApplication.instance.config.folder_list_pane_position = folder_paned.get_position();
|
||||
GearyApplication.instance.config.messages_pane_position = messages_paned.get_position();
|
||||
|
||||
GearyApplication.instance.exit();
|
||||
|
||||
base.destroy();
|
||||
|
|
@ -166,9 +175,6 @@ public class MainWindow : Gtk.Window {
|
|||
// main menu
|
||||
main_layout.pack_start(ui.get_widget("/MenuBar"), false, false, 0);
|
||||
|
||||
Gtk.HPaned folder_paned = new Gtk.HPaned();
|
||||
Gtk.HPaned messages_paned = new Gtk.HPaned();
|
||||
|
||||
// folder list
|
||||
Gtk.ScrolledWindow folder_list_scrolled = new Gtk.ScrolledWindow(null, null);
|
||||
folder_list_scrolled.set_policy(Gtk.PolicyType.NEVER, Gtk.PolicyType.AUTOMATIC);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue