[Scummvm-git-logs] scummvm master -> e3b56d8714bb0e2d07102cd66c1bbc6fda3af4ed
sev-
noreply at scummvm.org
Sun Feb 1 10:12:52 UTC 2026
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://api.github.com/repos/scummvm/scummvm .
Summary:
e3b56d8714 GUI: Mark selected item in multi-selection array for all widgets
Commit: e3b56d8714bb0e2d07102cd66c1bbc6fda3af4ed
https://github.com/scummvm/scummvm/commit/e3b56d8714bb0e2d07102cd66c1bbc6fda3af4ed
Author: Mohit Bankar (mohitbankar1212 at gmail.com)
Date: 2026-02-01T13:12:50+03:00
Commit Message:
GUI: Mark selected item in multi-selection array for all widgets
Update ListWidget, GridWidget, and GroupedListWidget setSelected() to
clear all selections and mark only the newly selected item when
multi-select is enabled.
Changed paths:
gui/widgets/grid.cpp
gui/widgets/groupedlist.cpp
gui/widgets/list.cpp
diff --git a/gui/widgets/grid.cpp b/gui/widgets/grid.cpp
index 3334e425dc7..57507da714d 100644
--- a/gui/widgets/grid.cpp
+++ b/gui/widgets/grid.cpp
@@ -1241,6 +1241,13 @@ void GridWidget::setSelected(int id) {
for (uint i = 0; i < _sortedEntryList.size(); ++i) {
if ((!_sortedEntryList[i]->isHeader) && (_sortedEntryList[i]->entryID == id)) {
_selectedEntry = _sortedEntryList[i];
+
+ // Clear previous selections and mark only this item
+ if (_multiSelectEnabled) {
+ clearSelection();
+ markSelectedItem(id, true);
+ }
+
scrollToEntry(id, false);
break;
}
diff --git a/gui/widgets/groupedlist.cpp b/gui/widgets/groupedlist.cpp
index ec31cfa6e54..e4162dfd2ca 100644
--- a/gui/widgets/groupedlist.cpp
+++ b/gui/widgets/groupedlist.cpp
@@ -213,6 +213,12 @@ void GroupedListWidget::setSelected(int item) {
_selectedItem = findDataIndex(item);
+ // Clear previous selections and mark only this item
+ if (_multiSelectEnabled) {
+ clearSelection();
+ markSelectedItem(_selectedItem, true);
+ }
+
// Notify clients that the selection changed.
sendCommand(kListSelectionChangedCmd, _selectedItem);
diff --git a/gui/widgets/list.cpp b/gui/widgets/list.cpp
index b6a5c2ac7f5..ff930f81dc8 100644
--- a/gui/widgets/list.cpp
+++ b/gui/widgets/list.cpp
@@ -186,6 +186,12 @@ void ListWidget::setSelected(int item) {
_selectedItem = item;
+ // Clear previous selections and mark only this item
+ if (_multiSelectEnabled) {
+ clearSelection();
+ markSelectedItem(item, true);
+ }
+
// Notify clients that the selection changed.
sendCommand(kListSelectionChangedCmd, _selectedItem);
More information about the Scummvm-git-logs
mailing list