From 5360856c31cf90ee7b9fbe75389acc55e1383071 Mon Sep 17 00:00:00 2001 From: Klement Sekera Date: Wed, 18 Mar 2026 10:47:44 +0100 Subject: [PATCH] settings: expose message_zoom to control web view zoom factor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The message body and compose panels use QWebEngineView, which renders CSS pt sizes larger than QFont point sizes in native Qt widgets like QTreeView — especially on macOS Retina displays. This causes the message body to appear noticeably larger than the thread list and header panels even when font sizes match. Extract the hardcoded setZoomFactor(1.2) into a configurable message_zoom setting so users can compensate for this discrepancy. Co-Authored-By: Claude Opus 4.6 --- dodo/compose.py | 2 +- dodo/settings.py | 11 +++++++++++ dodo/thread.py | 2 +- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/dodo/compose.py b/dodo/compose.py index bbb8b36..d058d11 100644 --- a/dodo/compose.py +++ b/dodo/compose.py @@ -66,7 +66,7 @@ def __init__(self, a: app.Dodo, mode: str='', msg: Optional[dict]=None, parent: self.mode = mode self.msg = msg self.message_view = QWebEngineView() - self.message_view.setZoomFactor(1.2) + self.message_view.setZoomFactor(settings.message_zoom) self.layout().addWidget(self.message_view) self.status = f'draft' self.current_account = 0 diff --git a/dodo/settings.py b/dodo/settings.py index c112eb2..5b05eb7 100644 --- a/dodo/settings.py +++ b/dodo/settings.py @@ -231,6 +231,17 @@ message_font_size = 12 """The font size used for plaintext messages""" +message_zoom = 1.2 +"""Zoom factor for the message and compose web views + +QWebEngineView renders CSS ``pt`` sizes larger than QFont uses for the same +point value in native Qt widgets (QTreeView, etc.), particularly on macOS +Retina displays. This means the message body appears bigger than the thread +list and header panels even when the configured font sizes match. Adjust +this factor to compensate — values below 1.0 shrink the web view to better +match the surrounding Qt widgets. +""" + search_view_padding = 1 """A bit of spacing around each line in the search panel""" diff --git a/dodo/thread.py b/dodo/thread.py index ab9c50a..da7bc97 100644 --- a/dodo/thread.py +++ b/dodo/thread.py @@ -557,7 +557,7 @@ def __init__(self, a: app.Dodo, thread_id: str, search_query: str, parent: Optio self.message_view = QWebEngineView(self) page = MessagePage(self.app, self.message_profile, self.message_view) self.message_view.setPage(page) - self.message_view.setZoomFactor(1.2) + self.message_view.setZoomFactor(settings.message_zoom) self.layout_panel()