diff options
| author | Danilo M. <danix@danix.xyz> | 2026-08-15 12:56:54 +0200 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-08-15 12:56:54 +0200 |
| commit | 854134ef967568f1441093774cf7497e8c5d6b11 (patch) | |
| tree | 2eafe37300fbedcaa6cdf028dc8531ad42e026fb /tests/test_htmlbuilder.cpp | |
| parent | c9392961aa3554a17ab88bfe3ad4e6b76b9a60bc (diff) | |
| download | qtmaildir-854134ef967568f1441093774cf7497e8c5d6b11.tar.gz qtmaildir-854134ef967568f1441093774cf7497e8c5d6b11.zip | |
feat(ui): highlight the built-in filter matching the current view
The four filter buttons gave no sign of which one you were looking at, so
the row said what you could do and never where you were.
The active filter is drawn as a checked QToolButton, which lets the style
paint its own pressed look: a hand-picked highlight colour would have to be
picked once per theme and would still be wrong under a third.
The check state is derived from the query TEXT rather than from the last
button clicked, which is the whole design decision. A record of what was
pressed goes on lying the moment the query is edited into something else,
where a highlight that follows the query clears itself and lights again
when a filter's query is typed by hand. It is resolved against the account
box, so changing account recomputes it rather than dropping it: the same
filter under two accounts is two different query strings and both are
still "Inbox".
Buttons are held in a hash keyed by generator, cleared at the top of the
row build because the row is rebuilt wholesale on every saved-query edit
and stale entries would dangle. The connections are owned by the row
widget, so a rebuild takes them with it rather than leaving a second copy
firing at deleted buttons.
Unread opens already highlighted, which is correct rather than incidental:
startup_query defaults to it, so the window opens on that view. The test
asserts it, so the assertions that follow are known to be a change of
state rather than a button that happened to start unchecked.
Mutation checked against the design that was rejected: deriving the state
from the click instead of the query fails all three tests, each naming the
behaviour it protects.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Diffstat (limited to 'tests/test_htmlbuilder.cpp')
0 files changed, 0 insertions, 0 deletions
