diff --git a/data/eu.polonkai.gergely.gnome-gitlab.gschema.xml.in.in b/data/eu.polonkai.gergely.gnome-gitlab.gschema.xml.in.in index efe29fd..b25e235 100644 --- a/data/eu.polonkai.gergely.gnome-gitlab.gschema.xml.in.in +++ b/data/eu.polonkai.gergely.gnome-gitlab.gschema.xml.in.in @@ -6,4 +6,25 @@ <_description>List of GitLab instances to show. + + + + + + + + 0 + <_summary>Window state + <_description> + State of the window: i.e. maximized. + + + + (800, 600) + <_summary>Window width and height + <_description> + Width and height of the window + + + diff --git a/src/gg-window.vala b/src/gg-window.vala index 1bb30a4..8a6f915 100644 --- a/src/gg-window.vala +++ b/src/gg-window.vala @@ -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 (); }