fix(search): restore the column show/hide menu and shift+page selection - #805
Draft
got3nks wants to merge 1 commit into
Draft
fix(search): restore the column show/hide menu and shift+page selection#805got3nks wants to merge 1 commit into
got3nks wants to merge 1 commit into
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two more behaviours the
wxDataViewCtrlport left behind, both of which every list still onwxListCtrlinherits for free fromCMuleListCtrl. 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
CSearchListCtrlwith the original semantics: hiding sets the column toCOL_SIZE_MINand caches the previous width, so re-showing restores what the user had, and the state persists throughCListColumnStore's existing width handling instead of needing a second mechanism.COL_SIZE_MINmoves from a file-local constant inMuleListCtrl.cpptoListColumnStore.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:
NSOutlineViewpages 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 becauseGetItemByRow()/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-formatand bothclang-tidytiers 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.