[gnome-games] ui: Save the window's maximized state in the gschema
- From: Adrien Plazas <aplazas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-games] ui: Save the window's maximized state in the gschema
- Date: Mon, 27 Feb 2017 07:53:00 +0000 (UTC)
commit e0eca86e7cbe4b3e22f20a2fbb71223a71ce44d5
Author: Adrien Plazas <kekun plazas laposte net>
Date: Mon Feb 27 07:37:38 2017 +0100
ui: Save the window's maximized state in the gschema
Save whether the window is maximized or not in the gschema and retrieve
this parameter to automatically set it back.
https://bugzilla.gnome.org/show_bug.cgi?id=779095
src/ui/application-window.vala | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/src/ui/application-window.vala b/src/ui/application-window.vala
index afe526a..9cc7de4 100644
--- a/src/ui/application-window.vala
+++ b/src/ui/application-window.vala
@@ -95,6 +95,9 @@ private class Games.ApplicationWindow : Gtk.ApplicationWindow {
construct {
settings = new Settings ("org.gnome.Games");
+ if (settings.get_boolean ("window-maximized"))
+ maximize ();
+
box_search_binding = bind_property ("search-mode", collection_box, "search-mode",
BindingFlags.BIDIRECTIONAL);
loading_notification_binding = bind_property ("loading-notification", collection_box,
"loading-notification",
@@ -180,6 +183,9 @@ private class Games.ApplicationWindow : Gtk.ApplicationWindow {
[GtkCallback]
public bool on_window_state_event (Gdk.EventWindowState event) {
+ var is_maximized = (bool) (event.new_window_state & Gdk.WindowState.MAXIMIZED);
+ settings.set_boolean ("window-maximized", is_maximized);
+
is_fullscreen = (bool) (event.new_window_state & Gdk.WindowState.FULLSCREEN);
update_pause (false);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]