[gnome-games/wip/exalm/views: 11/19] display-view: Add 'is-fullscreen'
- From: Alexander Mikhaylenko <alexm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-games/wip/exalm/views: 11/19] display-view: Add 'is-fullscreen'
- Date: Mon, 25 Feb 2019 09:23:54 +0000 (UTC)
commit c50e36ca00e86bb435fe07e2bfc7980df921dcd7
Author: Alexander Mikhaylenko <exalm7659 gmail com>
Date: Thu Oct 4 20:22:02 2018 +0500
display-view: Add 'is-fullscreen'
Make ApplicationWindow interact with DisplayView instead of its internals.
src/ui/application-window.vala | 12 ++++--------
src/ui/display-view.vala | 14 ++++++++++++++
2 files changed, 18 insertions(+), 8 deletions(-)
---
diff --git a/src/ui/application-window.vala b/src/ui/application-window.vala
index 28715d6f..f6e4c399 100644
--- a/src/ui/application-window.vala
+++ b/src/ui/application-window.vala
@@ -26,8 +26,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.box.runner != null) {
display_view.box.runner.stop ();
display_view.box.runner = null;
@@ -76,8 +74,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;
@@ -132,10 +129,9 @@ private class Games.ApplicationWindow : Gtk.ApplicationWindow {
"loading-notification",
BindingFlags.DEFAULT);
- box_fullscreen_binding = bind_property ("is-fullscreen", display_view.box, "is-fullscreen",
- BindingFlags.BIDIRECTIONAL);
- header_bar_fullscreen_binding = bind_property ("is-fullscreen", display_view.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 58db88ef..9e313c4a 100644
--- a/src/ui/display-view.vala
+++ b/src/ui/display-view.vala
@@ -22,11 +22,19 @@ private class Games.DisplayView: Object, UiView {
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;
+
public DisplayView (ApplicationWindow window) {
Object (window: window);
}
@@ -37,6 +45,12 @@ private class Games.DisplayView: Object, UiView {
box.back.connect (on_display_back);
header_bar.back.connect (on_display_back);
+
+ box_fullscreen_binding = bind_property ("is-fullscreen", box, "is-fullscreen",
+ BindingFlags.BIDIRECTIONAL);
+ header_bar_fullscreen_binding = bind_property ("is-fullscreen", header_bar,
+ "is-fullscreen",
+ BindingFlags.BIDIRECTIONAL);
}
public bool on_button_pressed (Gdk.EventButton event) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]