[gnome-games/wip/exalm/spinner: 25/25] application-window: Bind model only after loading
- From: Alexander Mikhaylenko <alexm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-games/wip/exalm/spinner: 25/25] application-window: Bind model only after loading
- Date: Sat, 9 Feb 2019 12:20:37 +0000 (UTC)
commit 41018abafbad9637d36df1febe8451809b42350a
Author: Alexander Mikhaylenko <exalm7659 gmail com>
Date: Sat Sep 22 15:55:40 2018 +0500
application-window: Bind model only after loading
Instead of binding collection model at the window creation time, wait
until everything has been loaded to improve loading speed.
src/ui/application-window.vala | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
---
diff --git a/src/ui/application-window.vala b/src/ui/application-window.vala
index 023b5e7e..0ac07a98 100644
--- a/src/ui/application-window.vala
+++ b/src/ui/application-window.vala
@@ -113,10 +113,12 @@ private class Games.ApplicationWindow : Gtk.ApplicationWindow {
private KonamiCode konami_code;
+ private ListModel collection;
+
private Game game_to_run;
public ApplicationWindow (ListModel collection) {
- collection_box.collection = collection;
+ this.collection = collection;
collection.items_changed.connect (() => {
is_collection_empty = collection.get_n_items () == 0;
});
@@ -740,6 +742,8 @@ private class Games.ApplicationWindow : Gtk.ApplicationWindow {
}
public void on_collection_loaded () {
+ collection_box.collection = collection;
+
content_box.transition_type = Gtk.StackTransitionType.CROSSFADE;
header_bar.transition_type = Gtk.StackTransitionType.CROSSFADE;
if (game_to_run != null) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]