[gnome-games] platforms-view: Ensure the first row is selected
- From: Alexander Mikhaylenko <alexm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-games] platforms-view: Ensure the first row is selected
- Date: Mon, 10 Feb 2020 18:54:28 +0000 (UTC)
commit f64751d9cdc64c4767aa6fe4a6270f077b114173
Author: Alexander Mikhaylenko <alexm gnome org>
Date: Mon Feb 10 23:53:37 2020 +0500
platforms-view: Ensure the first row is selected
Whoops, this was meant to be a part of 246e1729df3ce6929d46d6d431e6c0e2c0bbc720
src/ui/platforms-view.vala | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
---
diff --git a/src/ui/platforms-view.vala b/src/ui/platforms-view.vala
index 755a4077..95adf13d 100644
--- a/src/ui/platforms-view.vala
+++ b/src/ui/platforms-view.vala
@@ -20,6 +20,8 @@ private class Games.PlatformsView : Gtk.Bin {
private string[] filtering_terms;
+ private bool reset_selected_row;
+
private GameModel _game_model;
public GameModel game_model {
get { return _game_model; }
@@ -55,6 +57,7 @@ private class Games.PlatformsView : Gtk.Bin {
construct {
collection_view.set_game_filter (filter_game);
+ reset_selected_row = true;
}
private void apply_filter () {
@@ -66,6 +69,9 @@ private class Games.PlatformsView : Gtk.Bin {
widget.set_visible (filter_list (row));
});
+
+ if (reset_selected_row)
+ select_first_visible_row ();
}
private bool filter_list (PlatformListItem item) {
@@ -117,8 +123,8 @@ private class Games.PlatformsView : Gtk.Bin {
this.filtering_terms = filtering_terms;
collection_view.set_filter (filtering_terms);
+ reset_selected_row = true;
apply_filter ();
- select_first_visible_row ();
}
public bool gamepad_button_press_event (Manette.Event event) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]