Skip to content

fix(search): restore the column show/hide menu and shift+page selection - #805

Draft
got3nks wants to merge 1 commit into
amule-org:masterfrom
got3nks:fix/search-column-menu
Draft

fix(search): restore the column show/hide menu and shift+page selection#805
got3nks wants to merge 1 commit into
amule-org:masterfrom
got3nks:fix/search-column-menu

Conversation

@got3nks

@got3nks got3nks commented Aug 5, 2026

Copy link
Copy Markdown

Two more behaviours the wxDataViewCtrl port left behind, both of which every list still on wxListCtrl inherits for free from CMuleListCtrl. Same class as the three restored in #796 (multi-selection, type-to-select, select-all) and the reason #801 argues for a shared base before the next list is ported.

Column show/hide menu

Right-clicking a column header opened a check-menu of columns (CMuleListCtrl::OnColumnRClick/OnMenuSelected). The ported search list bound no header right-click handler at all, so there was no way to hide a column.

Restored on CSearchListCtrl with the original semantics: hiding sets the column to COL_SIZE_MIN and caches the previous width, so re-showing restores what the user had, and the state persists through CListColumnStore's existing width handling instead of needing a second mechanism.

COL_SIZE_MIN moves from a file-local constant in MuleListCtrl.cpp to ListColumnStore.h, beside the column-width interface, so both lists read one threshold rather than keeping copies. It is 10 on wxGTK — which won't shrink a column past the header grip — and 0 elsewhere, so this touches the GTK build in particular.

Shift+page-up/down on macOS

Shift+page-up/down extends the selection on GTK and MSW, whose backends implement it. On macOS it does nothing: NSOutlineView pages the view without touching the selection. Handled by hand under __WXOSX__ so the three ports agree; repeated presses keep extending, since it grows the existing selection between the cursor's old and new position.

Plain page-up/down is deliberately left to the platform — macOS scrolls without moving the selection by convention (Finder, Mail) — and that behaviour is unchanged.

Shared ordering

Both the existing type-ahead search and the new page handler need the top-level rows in displayed order, so that is factored into BuildDisplayOrder() and shared rather than written twice. It runs the rows through this list's own comparator because GetItemByRow()/GetRowByItem() exist only in wx's generic implementation, not on GTK or macOS.

Testing

Built clean on macOS, Ubuntu 26.04 arm64 (wxGTK 3.2.9) and Windows 11 arm64; clang-format and both clang-tidy tiers clean on the diff.

Draft until the interactive pass on all three is done — specifically that a hidden column stays hidden across a restart, and that the macOS page size feels right.

Two more behaviours the wxDataViewCtrl port left behind, both inherited
for free from CMuleListCtrl by every list that is still on wxListCtrl.

Right-clicking the header opened a check-menu of columns
(CMuleListCtrl::OnColumnRClick/OnMenuSelected); the ported search list
had no header right-click handler at all, so there was no way to hide a
column. Restored on CSearchListCtrl with the same semantics: hiding sets
the column to COL_SIZE_MIN and caches the previous width, so re-showing
restores what the user had and the state persists through
CListColumnStore's existing width handling rather than needing a second
mechanism. COL_SIZE_MIN moves from a file-local constant in
MuleListCtrl.cpp to ListColumnStore.h, next to the column-width
interface, so both lists read the same threshold instead of keeping
copies (it is 10 on wxGTK, which won't shrink a column past the header
grip, and 0 elsewhere).

Shift+page-up/down extends the selection on GTK and MSW, whose backends
implement it, but does nothing on macOS: NSOutlineView pages the view
without touching the selection. Handled by hand there so the three ports
agree. Plain page-up/down is deliberately left to the platform -- macOS
scrolls without moving the selection by convention, and that stays.

The row ordering the type-ahead search already needed is factored into
BuildDisplayOrder() and shared with the page handler rather than
duplicated; both need the top-level rows in displayed order, which means
running them through this list's own comparator since
GetItemByRow()/GetRowByItem() exist only in wx's generic implementation.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant