[Scummvm-git-logs] scummvm master -> e86fe749d70d9e70208deedafea711078dde8e09
sev-
noreply at scummvm.org
Wed Feb 25 09:11:09 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:
e86fe749d7 GUI: Enable advanced search in Grid view
Commit: e86fe749d70d9e70208deedafea711078dde8e09
https://github.com/scummvm/scummvm/commit/e86fe749d70d9e70208deedafea711078dde8e09
Author: phyulwin (phyulwin73929 at gmail.com)
Date: 2026-02-25T10:11:04+01:00
Commit Message:
GUI: Enable advanced search in Grid view
The Launcher search box supports rich syntax as documented
(e.g. engine:, platform:, lang=). This works correctly in
List view but was not working in Grid (Icons) view.
In Grid view, advanced expressions were ignored because
the filter logic was not hooked into GridWidget.
Connect GridWidget to the existing Launcher filter matcher so
Grid view uses the same search implementation as List view.
Changed paths:
gui/launcher.cpp
gui/widgets/grid.cpp
gui/widgets/grid.h
diff --git a/gui/launcher.cpp b/gui/launcher.cpp
index dbd1de787fd..5caae1956a4 100644
--- a/gui/launcher.cpp
+++ b/gui/launcher.cpp
@@ -1794,6 +1794,8 @@ void LauncherGrid::build() {
// Add list with game titles
_grid = new GridWidget(this, "LauncherGrid.IconArea");
_grid->setMultiSelectEnabled(true);
+ _grid->setFilterMatcher(LauncherFilterMatcher, this);
+
// Populate the list
updateListing();
@@ -1805,7 +1807,6 @@ void LauncherGrid::build() {
updateButtons();
}
-
void LauncherGrid::updateSelectionAfterRemoval() {
if (_grid) {
_grid->clearSelection();
diff --git a/gui/widgets/grid.cpp b/gui/widgets/grid.cpp
index e1e8f16176c..db29df1beaf 100644
--- a/gui/widgets/grid.cpp
+++ b/gui/widgets/grid.cpp
@@ -33,6 +33,10 @@
namespace GUI {
+bool GridWidgetDefaultMatcher(void *, int, const Common::U32String &item, const Common::U32String &token) {
+ return item.contains(token);
+}
+
GridItemWidget::GridItemWidget(GridWidget *boss)
: ContainerWidget(boss, 0, 0, 0, 0), CommandSender(boss) {
@@ -493,6 +497,9 @@ GridWidget::GridWidget(GuiObject *boss, const Common::String &name)
_multiSelectEnabled = false;
_selectedItems.clear();
_lastSelectedEntryID = -1;
+
+ _filterMatcher = GridWidgetDefaultMatcher;
+ _filterMatcherArg = nullptr;
}
GridWidget::~GridWidget() {
@@ -651,7 +658,7 @@ void GridWidget::sortGroups() {
bool matches = true;
tok.reset();
while (!tok.empty()) {
- if (!tmp.contains(tok.nextToken())) {
+ if (!_filterMatcher(_filterMatcherArg, i->entryID, tmp, tok.nextToken())) {
matches = false;
break;
}
@@ -1241,13 +1248,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/grid.h b/gui/widgets/grid.h
index d51db77086e..a6796fdb7bf 100644
--- a/gui/widgets/grid.h
+++ b/gui/widgets/grid.h
@@ -98,6 +98,9 @@ public:
/* GridWidget */
class GridWidget : public ContainerWidget, public CommandSender {
+public:
+ typedef bool (*FilterMatcher)(void *arg, int idx, const Common::U32String &item, const Common::U32String &token);
+
protected:
Common::HashMap<int, const Graphics::ManagedSurface *> _platformIcons;
Common::HashMap<int, const Graphics::ManagedSurface *> _languageIcons;
@@ -158,6 +161,9 @@ protected:
bool _multiSelectEnabled; /// Flag for multi-selection
+ FilterMatcher _filterMatcher;
+ void *_filterMatcherArg;
+
public:
int _gridItemHeight;
int _gridItemWidth;
@@ -234,6 +240,7 @@ public:
void setSelected(int id);
void setFilter(const Common::U32String &filter);
+ void setFilterMatcher(FilterMatcher matcher, void *arg) { _filterMatcher = matcher; _filterMatcherArg = arg; }
// Multi-selection methods
void setMultiSelectEnabled(bool enabled) { _multiSelectEnabled = enabled; }
More information about the Scummvm-git-logs
mailing list