1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2025-12-06 05:25:41 -05:00

feat: Ability to scale DMS font size

- Note: ideally the scaling is best performed in niri or hyprland
- This option adds the ability to override on top of the existing compositor options
This commit is contained in:
purian23
2025-09-07 22:57:47 -04:00
parent cd1c992abd
commit fcd818b098
3 changed files with 86 additions and 4 deletions

View File

@@ -81,6 +81,7 @@ Singleton {
property string fontFamily: "Inter Variable"
property string monoFontFamily: "Fira Code"
property int fontWeight: Font.Normal
property real fontScale: 1.0
property bool gtkThemingEnabled: false
property bool qtThemingEnabled: false
property bool showDock: false
@@ -243,6 +244,7 @@ Singleton {
fontFamily = settings.fontFamily !== undefined ? settings.fontFamily : defaultFontFamily
monoFontFamily = settings.monoFontFamily !== undefined ? settings.monoFontFamily : defaultMonoFontFamily
fontWeight = settings.fontWeight !== undefined ? settings.fontWeight : Font.Normal
fontScale = settings.fontScale !== undefined ? settings.fontScale : 1.0
gtkThemingEnabled = settings.gtkThemingEnabled !== undefined ? settings.gtkThemingEnabled : false
qtThemingEnabled = settings.qtThemingEnabled !== undefined ? settings.qtThemingEnabled : false
showDock = settings.showDock !== undefined ? settings.showDock : false
@@ -338,6 +340,7 @@ Singleton {
"fontFamily": fontFamily,
"monoFontFamily": monoFontFamily,
"fontWeight": fontWeight,
"fontScale": fontScale,
"gtkThemingEnabled": gtkThemingEnabled,
"qtThemingEnabled": qtThemingEnabled,
"showDock": showDock,
@@ -827,6 +830,11 @@ Singleton {
saveSettings()
}
function setFontScale(scale) {
fontScale = scale
saveSettings()
}
function setGtkThemingEnabled(enabled) {
gtkThemingEnabled = enabled
saveSettings()

View File

@@ -162,10 +162,10 @@ Singleton {
property real spacingM: 12
property real spacingL: 16
property real spacingXL: 24
property real fontSizeSmall: 12
property real fontSizeMedium: 14
property real fontSizeLarge: 16
property real fontSizeXLarge: 20
property real fontSizeSmall: (typeof SettingsData !== "undefined" ? SettingsData.fontScale : 1.0) * 12
property real fontSizeMedium: (typeof SettingsData !== "undefined" ? SettingsData.fontScale : 1.0) * 14
property real fontSizeLarge: (typeof SettingsData !== "undefined" ? SettingsData.fontScale : 1.0) * 16
property real fontSizeXLarge: (typeof SettingsData !== "undefined" ? SettingsData.fontScale : 1.0) * 20
property real barHeight: 48
property real iconSize: 24
property real iconSizeSmall: 16