Handle window state properly (implements #52)

Handle the window state as recommended by the Gnome HowDoI guide by
using the wrapper class WindowState with GObject properties and
bindings. Additionally use separate settings for width and height
instead of an array.
This commit is contained in:
coderkun 2018-07-10 22:45:29 +02:00
commit cb585cda1e
3 changed files with 49 additions and 30 deletions

View file

@ -26,15 +26,20 @@
<summary>Connection state</summary>
<description>State of last connection</description>
</key>
<key type="ai" name="window-size">
<default>[800, 600]</default>
<summary>Window size</summary>
<description>Window size (width and height).</description>
<key type="i" name="width">
<default>800</default>
<summary>Window width</summary>
<description>The window width in pixels.</description>
</key>
<key type="b" name="window-maximized">
<key type="i" name="height">
<default>600</default>
<summary>Window height</summary>
<description>The window height in pixels.</description>
</key>
<key type="b" name="is-maximized">
<default>false</default>
<summary>Window maximized</summary>
<description>Window maximized state.</description>
<description>Whether or not the window is in maximized state.</description>
</key>
<key type="i" name="panel">
<range min="0" max="3"/>

View file

@ -277,7 +277,6 @@
</object>
<object class="GtkApplicationWindow" id="appwindow">
<property name="can_focus">False</property>
<signal name="destroy" handler="on_appwindow_destroy" swapped="no"/>
<signal name="size-allocate" handler="on_appwindow_size_allocate" swapped="no"/>
<signal name="window-state-event" handler="on_appwindow_window_state_event" swapped="no"/>
<child type="titlebar">