forked from Shinonome/dots-hyprland
feat: refactor font settings and add width config option
This commit is contained in:
@@ -190,8 +190,11 @@ Singleton {
|
|||||||
property bool showDate: true
|
property bool showDate: true
|
||||||
property bool animateChange: true
|
property bool animateChange: true
|
||||||
property bool vertical: false
|
property bool vertical: false
|
||||||
property real weight: 350
|
property JsonObject font: JsonObject {
|
||||||
property real size: 90
|
property real weight: 350
|
||||||
|
property real width: 100
|
||||||
|
property real size: 90
|
||||||
|
}
|
||||||
}
|
}
|
||||||
property JsonObject quote: JsonObject {
|
property JsonObject quote: JsonObject {
|
||||||
property bool enable: false
|
property bool enable: false
|
||||||
|
|||||||
@@ -29,8 +29,11 @@ ColumnLayout {
|
|||||||
horizontalCenter: parent.horizontalCenter
|
horizontalCenter: parent.horizontalCenter
|
||||||
}
|
}
|
||||||
font {
|
font {
|
||||||
pixelSize: Config.options.background.widgets.clock.digital.size
|
pixelSize: Config.options.background.widgets.clock.digital.font.size
|
||||||
weight: Config.options.background.widgets.clock.digital.weight
|
weight: Config.options.background.widgets.clock.digital.font.weight
|
||||||
|
variableAxes: ({
|
||||||
|
"wdth": Config.options.background.widgets.clock.digital.font.width,
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ClockText {
|
ClockText {
|
||||||
@@ -43,8 +46,11 @@ ColumnLayout {
|
|||||||
horizontalCenter: parent.horizontalCenter
|
horizontalCenter: parent.horizontalCenter
|
||||||
}
|
}
|
||||||
font {
|
font {
|
||||||
pixelSize: Config.options.background.widgets.clock.digital.size
|
pixelSize: Config.options.background.widgets.clock.digital.font.size
|
||||||
weight: Config.options.background.widgets.clock.digital.weight
|
weight: Config.options.background.widgets.clock.digital.font.weight
|
||||||
|
variableAxes: ({
|
||||||
|
"wdth": Config.options.background.widgets.clock.digital.font.width,
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -215,24 +215,35 @@ ContentPage {
|
|||||||
}
|
}
|
||||||
ConfigSlider {
|
ConfigSlider {
|
||||||
text: Translation.tr("Font weight")
|
text: Translation.tr("Font weight")
|
||||||
value: Config.options.background.widgets.clock.digital.weight
|
value: Config.options.background.widgets.clock.digital.font.weight
|
||||||
usePercentTooltip: false
|
usePercentTooltip: false
|
||||||
buttonIcon: "format_bold"
|
buttonIcon: "format_bold"
|
||||||
from: 1
|
from: 1
|
||||||
to: 1000
|
to: 1000
|
||||||
onValueChanged: {
|
onValueChanged: {
|
||||||
Config.options.background.widgets.clock.digital.weight = value;
|
Config.options.background.widgets.clock.digital.font.weight = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ConfigSlider {
|
||||||
|
text: Translation.tr("Font Width")
|
||||||
|
value: Config.options.background.widgets.clock.digital.font.width
|
||||||
|
usePercentTooltip: false
|
||||||
|
buttonIcon: "fit_width"
|
||||||
|
from: 25
|
||||||
|
to: 125
|
||||||
|
onValueChanged: {
|
||||||
|
Config.options.background.widgets.clock.digital.font.width = value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ConfigSlider {
|
ConfigSlider {
|
||||||
text: Translation.tr("Font Size")
|
text: Translation.tr("Font Size")
|
||||||
value: Config.options.background.widgets.clock.digital.size
|
value: Config.options.background.widgets.clock.digital.font.size
|
||||||
usePercentTooltip: false
|
usePercentTooltip: false
|
||||||
buttonIcon: "format_size"
|
buttonIcon: "format_size"
|
||||||
from: 70
|
from: 70
|
||||||
to: 150
|
to: 150
|
||||||
onValueChanged: {
|
onValueChanged: {
|
||||||
Config.options.background.widgets.clock.digital.size = value;
|
Config.options.background.widgets.clock.digital.font.size = value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user