aboutsummaryrefslogtreecommitdiffstats
path: root/README.md
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-08-15 12:56:54 +0200
committerDanilo M. <danix@danix.xyz>2026-08-15 12:56:54 +0200
commit854134ef967568f1441093774cf7497e8c5d6b11 (patch)
tree2eafe37300fbedcaa6cdf028dc8531ad42e026fb /README.md
parentc9392961aa3554a17ab88bfe3ad4e6b76b9a60bc (diff)
downloadqtmaildir-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 'README.md')
-rw-r--r--README.md33
1 files changed, 29 insertions, 4 deletions
diff --git a/README.md b/README.md
index 85fc469..0127649 100644
--- a/README.md
+++ b/README.md
@@ -69,15 +69,29 @@ cmake -S . -B build -DQTMAILDIR_BUILD_TESTS=OFF
### Translations
-qtmaildir ships an Italian translation. The language is taken from the
-environment, so there is no configuration key of its own:
+qtmaildir ships an Italian translation. By default the language comes from the
+environment:
```bash
LANG=it_IT.UTF-8 qtmaildir
```
-Any other locale runs the application in English, which is also what happens
-when the compiled translation is missing.
+The `language` key under `[general]` overrides that, in both directions: it
+selects Italian on an English desktop, and forces English on an Italian one.
+A short code or a full locale name both work.
+
+```ini
+[general]
+language = it ; or it_IT
+; language = en_US ; force English whatever $LANG says
+; language = system ; follow the environment (the default)
+```
+
+Any language with no translation runs the application in English, which is also
+what happens when the compiled translation is missing. A value that is not a
+locale name at all is reported as a configuration problem rather than silently
+falling back, since `language = itallian` and `language = en_US` would
+otherwise look identical from the outside.
`translations/qtmaildir_it_IT.ts` is tracked in git; the `.qm` it compiles to
is generated at build time and is not. Building needs Qt6's `LinguistTools`,
@@ -146,6 +160,11 @@ identity.
; starts in "work - Inbox". It only sets the STARTING scope: clicking a saved
; query that names no account still clears the selection, as it always does.
; startup_account = work
+; Optional. Interface language, overriding the one your environment asks for.
+; A locale name, short or full: "it" and "it_IT" both select Italian. The
+; default is "system", which follows $LANG. Set it to a language qtmaildir
+; does not ship, or to English, and the interface stays in English.
+; language = system
; Optional. Toolbar icon size in pixels, 16 to 64. Defaults to 24. The
; toolbar follows your desktop's toolbar button style, so if that is set to
; "icon only" this is the whole size of the control; 16 matches what most
@@ -300,6 +319,12 @@ One behaviour changes with the move. Buttons used to appear in alphabetical
order, because the INI backend returns keys sorted and preserving file order
would have meant hand-rolling a parser. They now follow the file.
+The built-in filter whose query is currently in the bar is drawn as a pressed
+button, so the row shows which view you are in. It follows the query rather
+than the last button you clicked: editing the query by hand clears the
+highlight, and typing a filter's own query lights it. Changing the account
+recomputes it, since a filter composes with the dropdown.
+
`startup_query` looks at your saved queries first and then at the built-in
filters, so it can name either; yours wins if both carry the same name. A name
matching neither falls back to the **Unread** filter.