fix(gui): give the clients list the macOS spacer column, and assert on it - #852
Merged
Merged
Conversation
CGenericClientListCtrl is the only list ported to wxDataViewCtrl that never got a trailing spacer. macOS hands leftover width to the last *resizable* column, so once the columns are wider than the control that column collapses to nothing -- for Sources and Peers that is "Shares File List", and both panes sit in splitters that are routinely narrow. n_columns is the id to use: every model method here already answers a column past its own table with an empty value, so the spacer needs no further handling. Confirmed by building without spacers everywhere first: the collapse still reproduces, so the mechanism is not a leftover workaround for the legacy wxLC_REPORT|wxSUNKEN_BORDER flags removed in 71bdb1a and amule-project#849. The file-details list appeared immune only because its two columns do not overflow its dialog at their default widths, and columns are user-resizable.
Forgetting the spacer costs the last column: macOS gives the leftover width to the last *resizable* one, collapsing it to nothing as soon as the columns outgrow the control. Nothing about that is visible until somebody narrows the list far enough, which is how the clients list shipped without one and stayed that way for a release cycle. InitColumnState() is the one hook every list reaches unconditionally -- including CSearchListCtrl, which derives from CMuleDataViewCtrl directly rather than through CMuleVirtualDataViewCtrl, and which calls LoadColumnSettings() only for its first tab. Assert there, beside the existing column-id check, both being failures that look like rendering bugs rather than programming errors.
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 commits: the missing spacer on the clients list, and an assert so the next list cannot forget it.
The clients list had no spacer
CGenericClientListCtrlis the only list ported towxDataViewCtrlthat never got one. macOS hands leftover width to the last resizable column, so once the columns are wider than the control that column collapses to nothing. For Sources and Peers that is "Shares File List", and both panes sit in splitters that are routinely narrow.One line:
AppendSpacerColumn(m_columndata.n_columns). That id needs no further handling —GetItemColumnText(),GetItemBarFill()andCompareItemData()all already guardcolumn >= n_columns.Why the spacer is kept rather than removed
The obvious alternative was to drop the mechanism from all seven lists, on the theory that it was a workaround for the legacy
wxLC_REPORT|wxSUNKEN_BORDERflags —wxLC_REPORTbeing the same bit aswxDV_VARIABLE_LINE_HEIGHT— which came off in71bdb1aand #849.A spacer-less build was tried and the collapse still reproduces, so that theory is wrong. The file-details list looked immune only because its two columns (370 + 70) do not overflow its dialog at their default widths, and columns are user-resizable, so that is a property of the defaults rather than of the list. #851 has the details.
The assert
Forgetting the spacer is invisible until somebody narrows a list far enough, which is how the clients list shipped without one.
InitColumnState()is the single hook every list reaches unconditionally, so the check goes there, beside the existing column-id assert — both being failures that look like rendering bugs rather than programming errors.Appending the spacer from the base instead was considered and does not work: it has to happen after the subclass' columns and before
LoadColumnSettings(), andCSearchListCtrlcallsLoadColumnSettings()only for its first tab, so every later tab would silently lose its spacer.CSearchListCtrlalso derives fromCMuleDataViewCtrldirectly rather than throughCMuleVirtualDataViewCtrl;InitColumnState()is common to both, so one assert covers all seven lists.Testing
macOS Debug,
amule+amulegui. Narrowing Sources and Peers until the columns overflow no longer collapses the last column. Every list opened once with the assert live — Downloads, Sources, Servers, Search including a second tab, Shared Files, Peers, Friends and the file-details dialog — with no assert raised. clang-format 18 and Tier-2 clang-tidy clean on the diff with 0 compiler errors.Both the spacer and the assert are
__WXOSX__-only, so GTK and MSW are unaffected.