[gnome-games] collections-page: Add get_current_collection()
- From: Alexander Mikhaylenko <alexm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-games] collections-page: Add get_current_collection()
- Date: Fri, 31 Jul 2020 11:25:46 +0000 (UTC)
commit 0ac7a4f1b02a6a7a1b4f5722d22ddc088a1e596c
Author: Neville <nevilleantony98 gmail com>
Date: Wed Jul 29 16:44:25 2020 +0530
collections-page: Add get_current_collection()
This will be used to access the currently shown collection, in the main
collection view. Returns null if the collection subpage is not open.
src/ui/collections-page.vala | 10 ++++++++++
1 file changed, 10 insertions(+)
---
diff --git a/src/ui/collections-page.vala b/src/ui/collections-page.vala
index 822a9f126..4c5b84490 100644
--- a/src/ui/collections-page.vala
+++ b/src/ui/collections-page.vala
@@ -16,6 +16,8 @@ private class Games.CollectionsPage : Gtk.Bin {
[GtkChild]
private CollectionEmpty collection_empty_subpage;
+ private Collection current_collection;
+
private bool _is_collection_empty;
public bool is_collection_empty {
get { return _is_collection_empty; }
@@ -105,6 +107,13 @@ private class Games.CollectionsPage : Gtk.Bin {
return on_subpage_back_clicked ();
}
+ public Collection? get_current_collection () {
+ if (!is_subpage_open)
+ return null;
+
+ return current_collection;
+ }
+
[GtkCallback]
private bool on_subpage_back_clicked () {
if (!is_subpage_open)
@@ -117,6 +126,7 @@ private class Games.CollectionsPage : Gtk.Bin {
[GtkCallback]
private void on_collection_activated (Collection collection) {
+ current_collection = collection;
collection_title = collection.get_title ();
collections_deck.visible_child = collections_subpage_stack;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]