[gnome-games/wip/exalm/views: 9/14] application-window: Pass 'is-fullscreen' through DisplayBox
- From: Alexander Mikhaylenko <alexm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-games/wip/exalm/views: 9/14] application-window: Pass 'is-fullscreen' through DisplayBox
- Date: Thu, 4 Oct 2018 16:44:57 +0000 (UTC)
commit 33ea9e0b83bbbe711ab0366841f341f8ca0eb9bc
Author: Alexander Mikhaylenko <exalm7659 gmail com>
Date: Thu Oct 4 20:22:02 2018 +0500
application-window: Pass 'is-fullscreen' through DisplayBox
src/ui/application-window.vala | 12 ++++--------
src/ui/display-view.vala | 18 ++++++++++++++++++
2 files changed, 22 insertions(+), 8 deletions(-)
---
diff --git a/src/ui/application-window.vala b/src/ui/application-window.vala
index 0fc0a521..c6d8178b 100644
--- a/src/ui/application-window.vala
+++ b/src/ui/application-window.vala
@@ -24,8 +24,6 @@ private class Games.ApplicationWindow : Gtk.ApplicationWindow {
display_view.is_view_active = false;
collection_view.is_view_active = true;
- is_fullscreen = false;
-
if (display_view.display_box.runner != null) {
display_view.display_box.runner.stop ();
display_view.display_box.runner = null;
@@ -73,8 +71,7 @@ private class Games.ApplicationWindow : Gtk.ApplicationWindow {
private Settings settings;
- private Binding box_fullscreen_binding;
- private Binding header_bar_fullscreen_binding;
+ private Binding fullscreen_binding;
private Binding loading_notification_binding;
private Cancellable run_game_cancellable;
@@ -121,10 +118,9 @@ private class Games.ApplicationWindow : Gtk.ApplicationWindow {
"loading-notification",
BindingFlags.DEFAULT);
- box_fullscreen_binding = bind_property ("is-fullscreen", display_view.display_box,
"is-fullscreen",
- BindingFlags.BIDIRECTIONAL);
- header_bar_fullscreen_binding = bind_property ("is-fullscreen",
display_view.display_header_bar, "is-fullscreen",
- BindingFlags.BIDIRECTIONAL);
+ fullscreen_binding = bind_property ("is-fullscreen", display_view,
+ "is-fullscreen",
+ BindingFlags.BIDIRECTIONAL);
konami_code = new KonamiCode (this);
konami_code.code_performed.connect (on_konami_code_performed);
diff --git a/src/ui/display-view.vala b/src/ui/display-view.vala
index 784127c7..7da8dbd8 100644
--- a/src/ui/display-view.vala
+++ b/src/ui/display-view.vala
@@ -22,11 +22,29 @@ private class Games.DisplayView: Gtk.Bin, ApplicationView {
return;
_is_view_active = value;
+
+ if (!is_view_active)
+ is_fullscreen = false;
}
}
public ApplicationWindow window { get; construct set; }
+ public bool is_fullscreen { get; set; }
+
+ private Binding box_fullscreen_binding;
+ private Binding header_bar_fullscreen_binding;
+
+ construct {
+ box_fullscreen_binding = bind_property ("is-fullscreen", display_box,
+ "is-fullscreen",
+ BindingFlags.BIDIRECTIONAL);
+ header_bar_fullscreen_binding = bind_property ("is-fullscreen",
+ display_header_bar,
+ "is-fullscreen",
+ BindingFlags.BIDIRECTIONAL);
+ }
+
public bool on_button_pressed (Gdk.EventButton event) {
return false;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]