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