config: move quote settings to clock widget subsection

This commit is contained in:
end-4
2025-11-05 10:23:20 +01:00
parent b3f81f350c
commit 64f6081b14
4 changed files with 13 additions and 11 deletions
@@ -49,7 +49,7 @@ AbstractBackgroundWidget {
} }
FadeLoader { FadeLoader {
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
shown: Config.options.background.showQuote && Config.options.background.quote !== "" shown: Config.options.background.widgets.clock.quote.enable && Config.options.background.widgets.clock.quote.text !== ""
sourceComponent: CookieQuote {} sourceComponent: CookieQuote {}
} }
} }
@@ -73,7 +73,7 @@ AbstractBackgroundWidget {
} }
StyledText { StyledText {
// Somehow gets fucked up if made a ClockText??? // Somehow gets fucked up if made a ClockText???
visible: Config.options.background.showQuote && Config.options.background.quote.length > 0 visible: Config.options.background.widgets.clock.quote.enable && Config.options.background.widgets.clock.quote.text.length > 0
Layout.fillWidth: true Layout.fillWidth: true
horizontalAlignment: root.textHorizontalAlignment horizontalAlignment: root.textHorizontalAlignment
font { font {
@@ -83,7 +83,7 @@ AbstractBackgroundWidget {
color: root.colText color: root.colText
style: Text.Raised style: Text.Raised
styleColor: Appearance.colors.colShadow styleColor: Appearance.colors.colShadow
text: Config.options.background.quote text: Config.options.background.widgets.clock.quote.text
} }
} }
} }
@@ -7,7 +7,7 @@ import Qt5Compat.GraphicalEffects
Item { Item {
id: root id: root
readonly property string quoteText: Config.options.background.quote readonly property string quoteText: Config.options.background.widgets.clock.quote.text
implicitWidth: quoteBox.implicitWidth implicitWidth: quoteBox.implicitWidth
implicitHeight: quoteBox.implicitHeight implicitHeight: quoteBox.implicitHeight
@@ -47,7 +47,7 @@ Item {
StyledText { StyledText {
id: quoteStyledText id: quoteStyledText
horizontalAlignment: Text.AlignLeft horizontalAlignment: Text.AlignLeft
text: Config.options.background.quote text: Config.options.background.widgets.clock.quote.text
color: Appearance.colors.colOnSecondaryContainer color: Appearance.colors.colOnSecondaryContainer
font { font {
family: Appearance.font.family.reading family: Appearance.font.family.reading
@@ -169,6 +169,10 @@ Singleton {
property JsonObject digital: JsonObject { property JsonObject digital: JsonObject {
property bool animateChange: true property bool animateChange: true
} }
property JsonObject quote: JsonObject {
property bool enable: false
property string text: ""
}
} }
property JsonObject weather: JsonObject { property JsonObject weather: JsonObject {
property bool enable: false property bool enable: false
@@ -179,8 +183,6 @@ Singleton {
} }
property string wallpaperPath: "" property string wallpaperPath: ""
property string thumbnailPath: "" property string thumbnailPath: ""
property string quote: ""
property bool showQuote: false
property bool hideWhenFullscreen: true property bool hideWhenFullscreen: true
property JsonObject parallax: JsonObject { property JsonObject parallax: JsonObject {
property bool vertical: false property bool vertical: false
@@ -406,18 +406,18 @@ ContentPage {
ConfigSwitch { ConfigSwitch {
buttonIcon: "check" buttonIcon: "check"
text: Translation.tr("Enable") text: Translation.tr("Enable")
checked: Config.options.background.showQuote checked: Config.options.background.widgets.clock.quote.enable
onCheckedChanged: { onCheckedChanged: {
Config.options.background.showQuote = checked; Config.options.background.widgets.clock.quote.enable = checked;
} }
} }
MaterialTextArea { MaterialTextArea {
Layout.fillWidth: true Layout.fillWidth: true
placeholderText: Translation.tr("Quote") placeholderText: Translation.tr("Quote")
text: Config.options.background.quote text: Config.options.background.widgets.clock.quote.text
wrapMode: TextEdit.Wrap wrapMode: TextEdit.Wrap
onTextChanged: { onTextChanged: {
Config.options.background.quote = text; Config.options.background.widgets.clock.quote.text = text;
} }
} }
} }