[Scummvm-git-logs] scummvm master -> aac1eb12bf9e91b880e4f1f8e73e69ede402cf45

bluegr bluegr at gmail.com
Fri May 28 20:15:07 UTC 2021


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
aac1eb12bf GUI: Add delete/backspace support to save/load list


Commit: aac1eb12bf9e91b880e4f1f8e73e69ede402cf45
    https://github.com/scummvm/scummvm/commit/aac1eb12bf9e91b880e4f1f8e73e69ede402cf45
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2021-05-28T23:15:04+03:00

Commit Message:
GUI: Add delete/backspace support to save/load list

- SaveLoadChooserSimple responds to kListItemRemovalRequestCmd
- ListWidget::scrollToCurrent() only scrolls when there is a
  current selected item

Changed paths:
    gui/saveload-dialog.cpp
    gui/widgets/list.cpp


diff --git a/gui/saveload-dialog.cpp b/gui/saveload-dialog.cpp
index dc9e1a3a9f..a6c859c223 100644
--- a/gui/saveload-dialog.cpp
+++ b/gui/saveload-dialog.cpp
@@ -463,7 +463,8 @@ void SaveLoadChooserSimple::handleCommand(CommandSender *sender, uint32 cmd, uin
 		updateSelection(true);
 		break;
 	case kDelCmd:
-		if (selItem >= 0 && _delSupport) {
+	case kListItemRemovalRequestCmd:
+		if (_deleteButton->isEnabled()) {
 			MessageDialog alert(_("Do you really want to delete this saved game?"),
 								_("Delete"), _("Cancel"));
 			if (alert.runModal() == kMessageOK) {
diff --git a/gui/widgets/list.cpp b/gui/widgets/list.cpp
index e0c9820fdd..dc8c01e172 100644
--- a/gui/widgets/list.cpp
+++ b/gui/widgets/list.cpp
@@ -633,7 +633,7 @@ void ListWidget::checkBounds() {
 
 void ListWidget::scrollToCurrent() {
 	// Only do something if the current item is not in our view port
-	if (_selectedItem < _currentPos) {
+	if (_selectedItem != -1 && _selectedItem < _currentPos) {
 		// it's above our view
 		_currentPos = _selectedItem;
 	} else if (_selectedItem >= _currentPos + _entriesPerPage ) {




More information about the Scummvm-git-logs mailing list