Fixed font scaling on HiDPI monitors

This commit is contained in:
Hector van der Aa
2026-05-06 16:10:10 +02:00
parent f857a0a45c
commit fa879267c0
3 changed files with 3 additions and 2 deletions

View File

@@ -28,7 +28,7 @@ def run() -> None:
# Add Inter font to registry and bind as main app font
with dpg.font_registry():
app_font = dpg.add_font("./Inter-Regular.ttf", 18)
app_font = dpg.add_font("./Inter-Regular.ttf", 18*2)
dpg.bind_font(app_font)
dataflux.ui.windows.build_windows(state)

View File

@@ -1 +1 @@
/home/hector/projects/Exergie/TelemetryCommon/python/
/Users/hector/Projects/Exergie/TelemetryCommon/python

View File

@@ -22,6 +22,7 @@ def _add_live_data_row(label: str, value: str, tag: str, units: str) -> None:
def build_windows(state: AppState) -> None:
with dpg.window(label='DataFlux',tag="main_window", no_collapse=True):
dpg.set_global_font_scale(0.5)
with dpg.menu_bar():
with dpg.menu(label='File'):
dpg.add_menu_item(label="Connect", enabled=True, tag=MENU_FILE_CONNECT, callback=dataflux.callbacks.menu.open_connection_window)