[gnome-games] display-view: Bind game-title property
- From: Alexander Mikhaylenko <alexm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-games] display-view: Bind game-title property
- Date: Tue, 28 Jan 2020 14:40:22 +0000 (UTC)
commit 103800ceb585e0dc50b8f68171c223e10a307faa
Author: Alexander Mikhaylenko <alexm gnome org>
Date: Tue Jan 28 19:27:54 2020 +0500
display-view: Bind game-title property
src/ui/display-box.vala | 1 +
src/ui/display-header-bar.vala | 3 +++
src/ui/display-view.vala | 9 +++++++--
3 files changed, 11 insertions(+), 2 deletions(-)
---
diff --git a/src/ui/display-box.vala b/src/ui/display-box.vala
index 05aaaeea..45db5c9a 100644
--- a/src/ui/display-box.vala
+++ b/src/ui/display-box.vala
@@ -49,6 +49,7 @@ private class Games.DisplayBox : Gtk.Bin {
}
public bool can_fullscreen { get; set; }
+ public string game_title { get; set; }
[GtkChild]
private Gtk.Stack stack;
diff --git a/src/ui/display-header-bar.vala b/src/ui/display-header-bar.vala
index 29ff166c..875e1098 100644
--- a/src/ui/display-header-bar.vala
+++ b/src/ui/display-header-bar.vala
@@ -7,8 +7,11 @@ private class Games.DisplayHeaderBar : Gtk.Bin {
[GtkChild]
private MediaMenuButton media_button;
+ private string _game_title;
public string game_title {
+ get { return _game_title; }
set {
+ _game_title = value;
ingame_header_bar.title = value;
savestates_header_bar.title = value;
}
diff --git a/src/ui/display-view.vala b/src/ui/display-view.vala
index a3cab96c..2172d4d8 100644
--- a/src/ui/display-view.vala
+++ b/src/ui/display-view.vala
@@ -45,6 +45,7 @@ private class Games.DisplayView : Object, UiView {
public bool is_showing_snapshots { get; set; }
public Runner runner { get; set; }
+ public string game_title { get; set; }
private Settings settings;
@@ -99,6 +100,11 @@ private class Games.DisplayView : Object, UiView {
bind_property ("runner", header_bar,
"runner", BindingFlags.BIDIRECTIONAL);
+ bind_property ("game-title", box,
+ "game-title", BindingFlags.BIDIRECTIONAL);
+ bind_property ("game-title", header_bar,
+ "game-title", BindingFlags.BIDIRECTIONAL);
+
focus_out_timeout_id = -1;
action_group = new SimpleActionGroup ();
@@ -292,8 +298,7 @@ private class Games.DisplayView : Object, UiView {
}
private void run_game_with_cancellable (Game game, Cancellable cancellable) {
- header_bar.game_title = game.name;
- box.header_bar.game_title = game.name;
+ game_title = game.name;
// Reset the UI parts depending on the runner to avoid an
// inconsistent state is case we couldn't retrieve it.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]