forked from Shinonome/dots-hyprland
digital clock: add roundness slider and fix settings layout
This commit is contained in:
@@ -194,6 +194,7 @@ Singleton {
|
||||
property real weight: 350
|
||||
property real width: 100
|
||||
property real size: 90
|
||||
property real roundness: 0
|
||||
}
|
||||
}
|
||||
property JsonObject quote: JsonObject {
|
||||
|
||||
@@ -2,6 +2,7 @@ import qs.modules.common.widgets
|
||||
import qs.modules.common
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import qs.services
|
||||
|
||||
RowLayout {
|
||||
id: root
|
||||
@@ -12,12 +13,16 @@ RowLayout {
|
||||
property string text: ""
|
||||
property string buttonIcon: ""
|
||||
property alias value: slider.value
|
||||
property alias stopIndicatorValues: slider.stopIndicatorValues
|
||||
property bool usePercentTooltip: true
|
||||
property real from: slider.from
|
||||
property real to: slider.to
|
||||
|
||||
property real textWidth: 120
|
||||
|
||||
RowLayout {
|
||||
id: row
|
||||
spacing: 10
|
||||
|
||||
OptionalMaterialSymbol {
|
||||
id: iconWidget
|
||||
icon: root.buttonIcon
|
||||
@@ -25,6 +30,7 @@ RowLayout {
|
||||
}
|
||||
StyledText {
|
||||
id: labelWidget
|
||||
Layout.preferredWidth: root.textWidth
|
||||
text: root.text
|
||||
color: Appearance.colors.colOnSecondaryContainer
|
||||
}
|
||||
@@ -32,7 +38,6 @@ RowLayout {
|
||||
|
||||
StyledSlider {
|
||||
id: slider
|
||||
Layout.fillWidth: true
|
||||
configuration: StyledSlider.Configuration.XS
|
||||
usePercentTooltip: root.usePercentTooltip
|
||||
value: root.value
|
||||
|
||||
@@ -33,6 +33,7 @@ ColumnLayout {
|
||||
weight: Config.options.background.widgets.clock.digital.font.weight
|
||||
variableAxes: ({
|
||||
"wdth": Config.options.background.widgets.clock.digital.font.width,
|
||||
"ROND": Config.options.background.widgets.clock.digital.font.roundness
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -50,6 +51,7 @@ ColumnLayout {
|
||||
weight: Config.options.background.widgets.clock.digital.font.weight
|
||||
variableAxes: ({
|
||||
"wdth": Config.options.background.widgets.clock.digital.font.width,
|
||||
"ROND": Config.options.background.widgets.clock.digital.font.roundness
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -172,8 +172,10 @@ ContentPage {
|
||||
ContentSubsection {
|
||||
visible: settingsClock.digitalPresent
|
||||
title: Translation.tr("Digital clock settings")
|
||||
tooltip: Translation.tr("Font width and roundness settings are only available for some fonts like 'Google Sans Flex'")
|
||||
|
||||
ConfigRow {
|
||||
uniform: true
|
||||
ConfigSwitch {
|
||||
buttonIcon: "vertical_distribute"
|
||||
text: Translation.tr("Vertical")
|
||||
@@ -193,6 +195,9 @@ ContentPage {
|
||||
}
|
||||
|
||||
ConfigRow {
|
||||
uniform: true
|
||||
|
||||
|
||||
ConfigSwitch {
|
||||
buttonIcon: "date_range"
|
||||
text: Translation.tr("Show date")
|
||||
@@ -213,6 +218,8 @@ ContentPage {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
ConfigSlider {
|
||||
text: Translation.tr("Font weight")
|
||||
value: Config.options.background.widgets.clock.digital.font.weight
|
||||
@@ -220,21 +227,12 @@ ContentPage {
|
||||
buttonIcon: "format_bold"
|
||||
from: 1
|
||||
to: 1000
|
||||
stopIndicatorValues: [350]
|
||||
onValueChanged: {
|
||||
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 {
|
||||
text: Translation.tr("Font size")
|
||||
value: Config.options.background.widgets.clock.digital.font.size
|
||||
@@ -242,10 +240,35 @@ ContentPage {
|
||||
buttonIcon: "format_size"
|
||||
from: 70
|
||||
to: 150
|
||||
stopIndicatorValues: [90]
|
||||
onValueChanged: {
|
||||
Config.options.background.widgets.clock.digital.font.size = 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
|
||||
stopIndicatorValues: [100]
|
||||
onValueChanged: {
|
||||
Config.options.background.widgets.clock.digital.font.width = value;
|
||||
}
|
||||
}
|
||||
ConfigSlider {
|
||||
text: Translation.tr("Font roundness")
|
||||
value: Config.options.background.widgets.clock.digital.font.roundness
|
||||
usePercentTooltip: false
|
||||
buttonIcon: "line_curve"
|
||||
from: 0
|
||||
to: 100
|
||||
onValueChanged: {
|
||||
Config.options.background.widgets.clock.digital.font.roundness = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ContentSubsection {
|
||||
|
||||
Reference in New Issue
Block a user