[gnome-games] savestates-list: Avoid selecting the new savestate row on delete



commit 9ea55430ac824a4b219554f5d71d6473c9e20cee
Author: Yetizone <andreii lisita gmail com>
Date:   Fri Aug 16 15:09:28 2019 +0300

    savestates-list: Avoid selecting the new savestate row on delete
    
    Fixes runtime errors

 src/ui/savestates-list.vala | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/src/ui/savestates-list.vala b/src/ui/savestates-list.vala
index 75da8050..e84b358c 100644
--- a/src/ui/savestates-list.vala
+++ b/src/ui/savestates-list.vala
@@ -148,8 +148,8 @@ private class Games.SavestatesList : Gtk.Box {
                // Select and preview a new row
                var next_row = list_box.get_row_at_index (selected_row_index + 1);
 
-               if (next_row == null && list_box.get_children ().length () >= 1) {
-                       // The last row of the list has been deleted but there are still
+               if (next_row == null && selected_row_index > 1) {
+                       // The last row of the list will be deleted but there are still
                        // rows remaining in the list
                        next_row = list_box.get_row_at_index (selected_row_index - 1);
                }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]