Add window state to GSettings schema

This commit is contained in:
2014-10-14 17:10:10 +02:00
parent 026b19a17c
commit 180c3e2703
2 changed files with 41 additions and 0 deletions

View File

@@ -12,12 +12,32 @@ namespace GnomeGitlab
[GtkChild]
private Gtk.HeaderBar header_bar;
private GLib.Settings settings;
public Window (Application app)
{
Object (application: app);
add_action_entries (action_entries, this);
settings = new Settings ("eu.polonkai.gergely.gnome-gitlab.state.window");
settings.delay ();
destroy.connect (() => {
settings.apply ();
});
Gdk.WindowState window_state = (Gdk.WindowState)settings.get_int ("state");
if (Gdk.WindowState.MAXIMIZED in window_state) {
maximize ();
}
int width, height;
settings.get ("size", "(ii)", out width, out height);
resize (width, height);
show_all ();
}