summaryrefslogtreecommitdiff
path: root/ui/filter.h
diff options
context:
space:
mode:
authorMark Rowe <mark@vector35.com>2025-10-24 08:21:26 -0700
committerMark Rowe <mark@vector35.com>2025-11-04 16:04:04 -0800
commitade58079a0a3e6b9d1a0793ab4c084d0f9431f4d (patch)
tree1970e1e26858163d24d1359908b529f363789034 /ui/filter.h
parent63ef49621522efa11e1fcfc709812adb0300d3f6 (diff)
Update FilterEdit and FilterTarget to preserve existing selections
The down and enter keys now preserve an existing selection in the associated list or table views, rather than unconditionally selecting or activating the first item.
Diffstat (limited to 'ui/filter.h')
-rw-r--r--ui/filter.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/ui/filter.h b/ui/filter.h
index c354546f..98417f65 100644
--- a/ui/filter.h
+++ b/ui/filter.h
@@ -22,8 +22,16 @@ class BINARYNINJAUIAPI FilterTarget
virtual void setFilter(const std::string& filter) = 0;
virtual void scrollToFirstItem() = 0;
virtual void scrollToCurrentItem() = 0;
- virtual void selectFirstItem() = 0;
- virtual void activateFirstItem() = 0;
+
+ // Select an item, typically the first, if none is already selected.
+ virtual void ensureSelection() = 0;
+
+ // Activate the selected item, typically in response to the user
+ // pressing the return key.
+ virtual void activateSelection() = 0;
+
+ // Transfer focus away from the `FilterEdit`. By default, focus
+ // is transferred to `this` if it is an instance of `QWidget`.
virtual void closeFilter();
};