diff --git a/TODO.md b/TODO.md index 7d96db20..b660b620 100644 --- a/TODO.md +++ b/TODO.md @@ -3,7 +3,6 @@ - handle invalid access token - If an account is gone from the user's config, discard UI state last page - room A-Z sorting -- move uiScale to settings.json - up/down doesn't work in the middle of a @word for which autocompletion isn't open because no matches - filter > enter > room list is always scrolled to top diff --git a/src/backend/user_files.py b/src/backend/user_files.py index cbedd705..3e5a2d28 100644 --- a/src/backend/user_files.py +++ b/src/backend/user_files.py @@ -285,6 +285,8 @@ class UISettings(JSONDataFile): "ownMessagesOnLeftAboveWidth": 895, "theme": "Midnight.qpl", "writeAliases": {}, + "zoom": 1.0, + "media": { "autoLoad": True, "autoPlay": False, diff --git a/src/gui/UI.qml b/src/gui/UI.qml index c839f2ff..c838f2a8 100644 --- a/src/gui/UI.qml +++ b/src/gui/UI.qml @@ -64,17 +64,26 @@ Item { HShortcut { sequences: window.settings.keys.zoomIn - onActivated: theme.uiScale += 0.1 + onActivated: { + window.settings.zoom += 0.1 + window.settingsChanged() + } } HShortcut { sequences: window.settings.keys.zoomOut - onActivated: theme.uiScale = Math.max(0.1, theme.uiScale - 0.1) + onActivated: { + window.settings.zoom = Math.max(0.1, window.settings.zoom - 0.1) + window.settingsChanged() + } } HShortcut { sequences: window.settings.keys.zoomReset - onActivated: theme.uiScale = 1 + onActivated: { + window.settings.zoom = 1 + window.settingsChanged() + } } HShortcut { diff --git a/src/themes/Glass.qpl b/src/themes/Glass.qpl index b27c842b..6c04bf42 100644 --- a/src/themes/Glass.qpl +++ b/src/themes/Glass.qpl @@ -2,7 +2,7 @@ // Base variables -real uiScale: 1.0 +real uiScale: window.settings.zoom int minimumSupportedWidth: 240 * uiScale int minimumSupportedHeight: 120 * uiScale diff --git a/src/themes/Midnight.qpl b/src/themes/Midnight.qpl index ce6a17c8..795aab99 100644 --- a/src/themes/Midnight.qpl +++ b/src/themes/Midnight.qpl @@ -2,7 +2,7 @@ // Base variables -real uiScale: 1.0 +real uiScale: window.settings.zoom int minimumSupportedWidth: 240 * uiScale int minimumSupportedHeight: 120 * uiScale