From afe628ed7408c43badfcdb967a668d6f89319049 Mon Sep 17 00:00:00 2001 From: Adam0 Date: Sat, 4 Apr 2026 23:05:13 +0100 Subject: [PATCH] Add configurable fonts and overview top margin --- EXAMPLE.md | 17 +++++++++++++++++ common/Appearance.qml | 16 ++++++++-------- common/Config.qml | 20 ++++++++++++++++++++ modules/overview/Overview.qml | 4 +++- 4 files changed, 48 insertions(+), 9 deletions(-) diff --git a/EXAMPLE.md b/EXAMPLE.md index 40dca40..834617d 100644 --- a/EXAMPLE.md +++ b/EXAMPLE.md @@ -19,6 +19,20 @@ Path: `~/.config/overzicht/settings.json` "screenRounding": 0, "windowRounding": 0 }, + "font": { + "family": { + "main": "sans-serif", + "title": "sans-serif", + "expressive": "sans-serif" + }, + "pixelSize": { + "smaller": 12, + "small": 15, + "normal": 16, + "larger": 19, + "huge": 22 + } + }, "animation": { "duration": { "elementMove": 500, @@ -40,6 +54,9 @@ Path: `~/.config/overzicht/settings.json` "backgroundPadding": 10, "workspaceNumberBaseSize": 250 }, + "position": { + "topMargin": 100 + }, "windowPreview": { "iconToWindowRatio": 0.25, "iconToWindowRatioCompact": 0.45, diff --git a/common/Appearance.qml b/common/Appearance.qml index ca56731..8c13e41 100644 --- a/common/Appearance.qml +++ b/common/Appearance.qml @@ -126,16 +126,16 @@ Singleton { font: QtObject { property QtObject family: QtObject { - property string main: root.themeValue(["font", "family", "main"], "sans-serif") - property string title: root.themeValue(["font", "family", "title"], "sans-serif") - property string expressive: root.themeValue(["font", "family", "expressive"], "sans-serif") + property string main: Config.optionValue(["appearance", "font", "family", "main"], root.themeValue(["font", "family", "main"], "sans-serif")) + property string title: Config.optionValue(["appearance", "font", "family", "title"], root.themeValue(["font", "family", "title"], "sans-serif")) + property string expressive: Config.optionValue(["appearance", "font", "family", "expressive"], root.themeValue(["font", "family", "expressive"], "sans-serif")) } property QtObject pixelSize: QtObject { - property int smaller: root.themeValue(["font", "pixelSize", "smaller"], 12) - property int small: root.themeValue(["font", "pixelSize", "small"], 15) - property int normal: root.themeValue(["font", "pixelSize", "normal"], 16) - property int larger: root.themeValue(["font", "pixelSize", "larger"], 19) - property int huge: root.themeValue(["font", "pixelSize", "huge"], 22) + property int smaller: Config.optionValue(["appearance", "font", "pixelSize", "smaller"], root.themeValue(["font", "pixelSize", "smaller"], 12)) + property int small: Config.optionValue(["appearance", "font", "pixelSize", "small"], root.themeValue(["font", "pixelSize", "small"], 15)) + property int normal: Config.optionValue(["appearance", "font", "pixelSize", "normal"], root.themeValue(["font", "pixelSize", "normal"], 16)) + property int larger: Config.optionValue(["appearance", "font", "pixelSize", "larger"], root.themeValue(["font", "pixelSize", "larger"], 19)) + property int huge: Config.optionValue(["appearance", "font", "pixelSize", "huge"], root.themeValue(["font", "pixelSize", "huge"], 22)) } } diff --git a/common/Config.qml b/common/Config.qml index b78a14e..fd3e321 100644 --- a/common/Config.qml +++ b/common/Config.qml @@ -67,6 +67,22 @@ Singleton { property int windowRounding: root.optionValue(["appearance", "rounding", "windowRounding"], 0) } + property QtObject font: QtObject { + property QtObject family: QtObject { + property string main: root.optionValue(["appearance", "font", "family", "main"], "sans-serif") + property string title: root.optionValue(["appearance", "font", "family", "title"], "sans-serif") + property string expressive: root.optionValue(["appearance", "font", "family", "expressive"], "sans-serif") + } + + property QtObject pixelSize: QtObject { + property int smaller: root.optionValue(["appearance", "font", "pixelSize", "smaller"], 12) + property int small: root.optionValue(["appearance", "font", "pixelSize", "small"], 15) + property int normal: root.optionValue(["appearance", "font", "pixelSize", "normal"], 16) + property int larger: root.optionValue(["appearance", "font", "pixelSize", "larger"], 19) + property int huge: root.optionValue(["appearance", "font", "pixelSize", "huge"], 22) + } + } + property QtObject animation: QtObject { property QtObject duration: QtObject { property int elementMove: root.optionValue(["appearance", "animation", "duration", "elementMove"], 500) @@ -91,6 +107,10 @@ Singleton { property real workspaceNumberBaseSize: root.optionValue(["overview", "workspaceNumberBaseSize"], 250) } + property QtObject position: QtObject { + property real topMargin: root.optionValue(["position", "topMargin"], 100) + } + property QtObject windowPreview: QtObject { property real iconToWindowRatio: root.optionValue(["windowPreview", "iconToWindowRatio"], 0.25) property real iconToWindowRatioCompact: root.optionValue(["windowPreview", "iconToWindowRatioCompact"], 0.45) diff --git a/modules/overview/Overview.qml b/modules/overview/Overview.qml index b9f674d..b89223c 100644 --- a/modules/overview/Overview.qml +++ b/modules/overview/Overview.qml @@ -147,7 +147,9 @@ Scope { ColumnLayout { id: columnLayout visible: GlobalStates.overviewOpen - anchors.centerIn: parent + anchors.horizontalCenter: parent.horizontalCenter + anchors.top: parent.top + anchors.topMargin: Config.options.position.topMargin Loader { id: overviewLoader -- 2.51.2