summaryrefslogtreecommitdiffstats
path: root/src/config.h
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-08-09 09:54:00 +0200
committerDanilo M. <danix@danix.xyz>2026-08-09 09:54:00 +0200
commit955c273565521d9559e5760ca252a77c53a7aaa9 (patch)
tree08ff85b9b46c5c823851acffa41ff11940ac6630 /src/config.h
parent2e66bb8b66df016164d44bf72a2d53b8c4a67dde (diff)
downloadqtmaildir-955c273565521d9559e5760ca252a77c53a7aaa9.tar.gz
qtmaildir-955c273565521d9559e5760ca252a77c53a7aaa9.zip
feat(ui): make the toolbar icon size configurable
Follow-up to item 56. With the toolbar now following the desktop's button style, an "icon only" desktop makes the icon the whole control, and this style reports PM_ToolBarIconSize as 16px, which is a small target for a button with no text beside it. A [general] toolbar_icon_size key, 16 to 64, defaulting to 24 rather than to the style's own metric. Setting it to 16 restores the theme's value. Clamped and reported, unlike message_zoom, which documents a 0.5 to 3.0 range in the README and enforces none of it. Both ends here break the UI that would be used to fix them: too small is an invisible icon, too large is a toolbar taller than the window. The unenforced message_zoom range is recorded as item 58 rather than fixed here, since it is a separate defect that predates this change. Also documents in the README that saved-query button labels are the key names from the user's own [queries] section, which is why the "Flagged" button still read that way after the action was renamed: it is a user's query name, not a string this code owns. The sample config now shows `Important = tag:flagged` to teach the wording the UI uses. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Diffstat (limited to 'src/config.h')
-rw-r--r--src/config.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/config.h b/src/config.h
index 3174a03..3dd9011 100644
--- a/src/config.h
+++ b/src/config.h
@@ -90,6 +90,18 @@ public:
/// Empty when unset; the caller disables the Sync button in that case.
QString syncCommand() const { return m_syncCommand; }
+ /// Toolbar icon size in pixels, 16 to 64, defaulting to 24.
+ ///
+ /// The desktop's own PM_ToolBarIconSize was the obvious default and was
+ /// rejected empirically: it reports 16 here, which is a small target now
+ /// that the toolbar follows the platform's "icon only" style and the icon
+ /// is the whole control. Setting this to 16 restores the theme's value.
+ ///
+ /// Clamped rather than trusted: a 4px icon is invisible and a 4000px one
+ /// makes the toolbar taller than the window, and neither is recoverable
+ /// from the UI the value just broke.
+ int toolbarIconSize() const { return m_toolbarIconSize; }
+
/// The sync script's log file, read to learn the outcome of a sync this
/// process did not start (item 54).
///
@@ -171,6 +183,7 @@ private:
QList<SavedQuery> m_savedQueries;
QString m_syncCommand;
QString m_syncLog;
+ int m_toolbarIconSize = 24;
QString m_notmuchConfig;
qreal m_messageZoom = 1.0;
bool m_completionOnFocus = false;