[gnome-games] header-bar: Add display_back() signal
- From: Adrien Plazas <aplazas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-games] header-bar: Add display_back() signal
- Date: Fri, 25 Mar 2016 12:53:26 +0000 (UTC)
commit 13542bf385805cfb5c5d6aec90f1dc9f3e466a54
Author: Adrien Plazas <kekun plazas laposte net>
Date: Sun Mar 6 19:40:56 2016 +0100
header-bar: Add display_back() signal
This will be used to let the application window check if we can safely
quit the game when going back to the collection.
src/ui/application-window.vala | 4 ++++
src/ui/header-bar.vala | 4 +++-
2 files changed, 7 insertions(+), 1 deletions(-)
---
diff --git a/src/ui/application-window.vala b/src/ui/application-window.vala
index b434f26..1a62cd4 100644
--- a/src/ui/application-window.vala
+++ b/src/ui/application-window.vala
@@ -50,6 +50,10 @@ private class Games.ApplicationWindow : Gtk.ApplicationWindow {
this, "search-mode",
BindingFlags.BIDIRECTIONAL);
hb_search_binding = header_bar.bind_property ("search-mode",
this, "search-mode",
BindingFlags.BIDIRECTIONAL);
+
+ header_bar.display_back.connect (() => {
+ ui_state = UiState.COLLECTION;
+ });
}
[GtkCallback]
diff --git a/src/ui/header-bar.vala b/src/ui/header-bar.vala
index b972f30..3662653 100644
--- a/src/ui/header-bar.vala
+++ b/src/ui/header-bar.vala
@@ -2,6 +2,8 @@
[GtkTemplate (ui = "/org/gnome/Games/ui/header-bar.ui")]
private class Games.HeaderBar : Gtk.Stack {
+ public signal void display_back ();
+
private UiState _ui_state;
public UiState ui_state {
set {
@@ -47,6 +49,6 @@ private class Games.HeaderBar : Gtk.Stack {
[GtkCallback]
private void on_display_back_clicked () {
- ui_state = UiState.COLLECTION;
+ display_back ();
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]