From 43500a567a616f0b84b4fbcc5e223c4d185a50f3 Mon Sep 17 00:00:00 2001 From: Zach Domke Date: Wed, 19 Nov 2025 15:00:17 -0800 Subject: [PATCH] FIX: Fixing issue with font size adjusting --- trace/stylesheets/dark_mode.qss | 5 ++--- trace/stylesheets/light_mode.qss | 5 ++--- trace/widgets/plot_settings.py | 4 ++-- trace/widgets/settings_components.py | 4 ++-- 4 files changed, 8 insertions(+), 10 deletions(-) diff --git a/trace/stylesheets/dark_mode.qss b/trace/stylesheets/dark_mode.qss index 94a6975c..b3194c36 100644 --- a/trace/stylesheets/dark_mode.qss +++ b/trace/stylesheets/dark_mode.qss @@ -1,7 +1,6 @@ /* Global Styles */ QWidget { background-color: #1E1E1E; - font-size: 10px; color: #E0E0E0; } @@ -168,7 +167,7 @@ QWidget[collapsible=true] { QLabel[sectionHeader=true] { font-weight: bold; - font-size: 11px; + font-size: 11pt; color: #E0E0E0; } @@ -282,7 +281,7 @@ QToolTip { color: #FFFFFF; border: 1px solid #888888; padding: 4px; - font-size: 10px; + font-size: 10pt; } /* Scrollbars */ diff --git a/trace/stylesheets/light_mode.qss b/trace/stylesheets/light_mode.qss index 1fdd5d97..7a72bb03 100644 --- a/trace/stylesheets/light_mode.qss +++ b/trace/stylesheets/light_mode.qss @@ -1,7 +1,6 @@ /* Global Styles */ QWidget { background-color: #FAFAFA; - font-size: 10px; color: #202020; } @@ -168,7 +167,7 @@ QWidget[collapsible=true] { QLabel[sectionHeader=true] { font-weight: bold; - font-size: 11px; + font-size: 11pt; color: #E0E0E0; } @@ -282,7 +281,7 @@ QToolTip { color: #FFFFFF; border: 1px solid #888888; padding: 4px; - font-size: 10px; + font-size: 10pt; } /* Scrollbars */ diff --git a/trace/widgets/plot_settings.py b/trace/widgets/plot_settings.py index de407380..9fcc7aa7 100644 --- a/trace/widgets/plot_settings.py +++ b/trace/widgets/plot_settings.py @@ -197,10 +197,10 @@ def set_axis_tick_font_size(self, size: int) -> None: Parameters ---------- size : int - The font size in pixels + The font size in points """ font = QFont() - font.setPixelSize(size) + font.setPointSize(size) all_axes = self.plot.plotItem.getAxes() for axis in all_axes: diff --git a/trace/widgets/settings_components.py b/trace/widgets/settings_components.py index 515ac285..5ce27b4e 100644 --- a/trace/widgets/settings_components.py +++ b/trace/widgets/settings_components.py @@ -27,13 +27,13 @@ def __init__(self, parent: QWidget, text: str, size: int = None): text : str The title text to display size : int, optional - Custom font size in pixels + Custom font size in points """ super().__init__(text=text, parent=parent) bold_font = QFont() bold_font.setBold(True) if size is not None: - bold_font.setPixelSize(size) + bold_font.setPointSize(size) self.setFont(bold_font)