diff options
| author | Danilo M. <danix@danix.xyz> | 2026-08-08 10:56:58 +0200 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-08-08 10:56:58 +0200 |
| commit | 0c987310113f148e97b59da74c446f78356b98ff (patch) | |
| tree | a6171bb54884860e8b340de1366542a9e216c36c /src/main.cpp | |
| parent | b01b44812ff29b2befc81cabd6ab61dc515c6da3 (diff) | |
| download | qtmaildir-0c987310113f148e97b59da74c446f78356b98ff.tar.gz qtmaildir-0c987310113f148e97b59da74c446f78356b98ff.zip | |
fix(ui): make the expander visible and the reply indent readable
Both were reported from the running application after the previous commit
claimed them working, and the tests that passed could not see either fault.
The expander took four attempts, each of which looked right in code:
- QTreeView::drawBranches is the documented hook and does not work here. It
runs BEFORE the row's cells, so with the expander on a content column the
delegate's own background paints over it. A 60-pixel triangle survived as
8, indistinguishable from the theme's near-invisible dot.
- Sizing the glyph from the row rather than the branch rect put most of it
outside that rect.
- Moving it into SubjectDelegate but calling it from only the no-chip branch
left every real row without one, since every real row has an account chip
and takes the other branch.
It is now drawn by the delegate, which owns the cell and paints after the
background, from both branches, with setRootIsDecorated(false) so the style
does not draw its dot underneath.
The indent was 20px and invisible for a reason the geometry could not show: a
thread row draws an account chip before its subject and a reply row does not, so
a reply's text already starts about a chip's width LEFT of its thread's. The
indent has to beat that before any nesting reads at all, hence 72px.
The indent test asserted on visualRect, which was correctly indented the whole
time, and so passed against a build with no visible nesting. It now measures
where the TEXT lands, accounting for the chip, and fails at 20px. The new
expander test counts painted pixels of the glyph colour against a control row
with no replies, and fails when the call is dropped from either branch.
Diffstat (limited to 'src/main.cpp')
0 files changed, 0 insertions, 0 deletions
