forked from Shinonome/dots-hyprland
add setting to show/hide the clock in background (#1881)
This commit is contained in:
@@ -117,8 +117,8 @@ Variants {
|
|||||||
function updateClockPosition() {
|
function updateClockPosition() {
|
||||||
// Somehow all this manual setting is needed to make the proc correctly use the new values
|
// Somehow all this manual setting is needed to make the proc correctly use the new values
|
||||||
leastBusyRegionProc.path = bgRoot.wallpaperPath
|
leastBusyRegionProc.path = bgRoot.wallpaperPath
|
||||||
leastBusyRegionProc.contentWidth = clock.implicitWidth + root.clockSizePadding * 2
|
leastBusyRegionProc.contentWidth = clockLoader.implicitWidth + root.clockSizePadding * 2
|
||||||
leastBusyRegionProc.contentHeight = clock.implicitHeight + root.clockSizePadding * 2
|
leastBusyRegionProc.contentHeight = clockLoader.implicitHeight + root.clockSizePadding * 2
|
||||||
leastBusyRegionProc.horizontalPadding = bgRoot.movableXSpace + root.screenSizePadding * 2
|
leastBusyRegionProc.horizontalPadding = bgRoot.movableXSpace + root.screenSizePadding * 2
|
||||||
leastBusyRegionProc.verticalPadding = bgRoot.movableYSpace + root.screenSizePadding * 2
|
leastBusyRegionProc.verticalPadding = bgRoot.movableYSpace + root.screenSizePadding * 2
|
||||||
leastBusyRegionProc.running = false;
|
leastBusyRegionProc.running = false;
|
||||||
@@ -215,8 +215,9 @@ Variants {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// The clock
|
// The clock
|
||||||
Item {
|
Loader {
|
||||||
id: clock
|
id: clockLoader
|
||||||
|
active: Config.options.background.showClock
|
||||||
anchors {
|
anchors {
|
||||||
left: wallpaper.left
|
left: wallpaper.left
|
||||||
top: wallpaper.top
|
top: wallpaper.top
|
||||||
@@ -229,93 +230,95 @@ Variants {
|
|||||||
animation: Appearance.animation.elementMove.numberAnimation.createObject(this)
|
animation: Appearance.animation.elementMove.numberAnimation.createObject(this)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
sourceComponent: Item {
|
||||||
|
id: clock
|
||||||
|
implicitWidth: clockColumn.implicitWidth
|
||||||
|
implicitHeight: clockColumn.implicitHeight
|
||||||
|
|
||||||
implicitWidth: clockColumn.implicitWidth
|
ColumnLayout {
|
||||||
implicitHeight: clockColumn.implicitHeight
|
id: clockColumn
|
||||||
|
anchors.centerIn: parent
|
||||||
|
spacing: 6
|
||||||
|
|
||||||
ColumnLayout {
|
StyledText {
|
||||||
id: clockColumn
|
Layout.fillWidth: true
|
||||||
anchors.centerIn: parent
|
horizontalAlignment: bgRoot.textHorizontalAlignment
|
||||||
spacing: 6
|
font {
|
||||||
|
family: Appearance.font.family.expressive
|
||||||
StyledText {
|
pixelSize: 90
|
||||||
Layout.fillWidth: true
|
weight: Font.Bold
|
||||||
horizontalAlignment: bgRoot.textHorizontalAlignment
|
}
|
||||||
font {
|
color: bgRoot.colText
|
||||||
family: Appearance.font.family.expressive
|
style: Text.Raised
|
||||||
pixelSize: 90
|
styleColor: Appearance.colors.colShadow
|
||||||
weight: Font.Bold
|
text: DateTime.time
|
||||||
}
|
}
|
||||||
color: bgRoot.colText
|
StyledText {
|
||||||
style: Text.Raised
|
Layout.fillWidth: true
|
||||||
styleColor: Appearance.colors.colShadow
|
Layout.topMargin: -5
|
||||||
text: DateTime.time
|
horizontalAlignment: bgRoot.textHorizontalAlignment
|
||||||
}
|
font {
|
||||||
StyledText {
|
family: Appearance.font.family.expressive
|
||||||
Layout.fillWidth: true
|
pixelSize: 20
|
||||||
Layout.topMargin: -5
|
weight: Font.DemiBold
|
||||||
horizontalAlignment: bgRoot.textHorizontalAlignment
|
}
|
||||||
font {
|
color: bgRoot.colText
|
||||||
family: Appearance.font.family.expressive
|
style: Text.Raised
|
||||||
pixelSize: 20
|
styleColor: Appearance.colors.colShadow
|
||||||
weight: Font.DemiBold
|
text: DateTime.date
|
||||||
|
animateChange: true
|
||||||
}
|
}
|
||||||
color: bgRoot.colText
|
StyledText {
|
||||||
style: Text.Raised
|
Layout.fillWidth: true
|
||||||
styleColor: Appearance.colors.colShadow
|
horizontalAlignment: bgRoot.textHorizontalAlignment
|
||||||
text: DateTime.date
|
font {
|
||||||
animateChange: true
|
family: Appearance.font.family.expressive
|
||||||
}
|
pixelSize: 20
|
||||||
StyledText {
|
weight: Font.DemiBold
|
||||||
Layout.fillWidth: true
|
}
|
||||||
horizontalAlignment: bgRoot.textHorizontalAlignment
|
color: bgRoot.colText
|
||||||
font {
|
style: Text.Raised
|
||||||
family: Appearance.font.family.expressive
|
visible: Config.options.background.quote !== ""
|
||||||
pixelSize: 20
|
styleColor: Appearance.colors.colShadow
|
||||||
weight: Font.DemiBold
|
text: Config.options.background.quote
|
||||||
}
|
}
|
||||||
color: bgRoot.colText
|
|
||||||
style: Text.Raised
|
|
||||||
visible: Config.options.background.quote !== ""
|
|
||||||
styleColor: Appearance.colors.colShadow
|
|
||||||
text: Config.options.background.quote
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
RowLayout {
|
RowLayout {
|
||||||
anchors {
|
anchors {
|
||||||
top: clockColumn.bottom
|
top: clockColumn.bottom
|
||||||
left: bgRoot.textHorizontalAlignment === Text.AlignLeft ? clockColumn.left : undefined
|
left: bgRoot.textHorizontalAlignment === Text.AlignLeft ? clockColumn.left : undefined
|
||||||
right: bgRoot.textHorizontalAlignment === Text.AlignRight ? clockColumn.right : undefined
|
right: bgRoot.textHorizontalAlignment === Text.AlignRight ? clockColumn.right : undefined
|
||||||
horizontalCenter: bgRoot.textHorizontalAlignment === Text.AlignHCenter ? clockColumn.horizontalCenter : undefined
|
horizontalCenter: bgRoot.textHorizontalAlignment === Text.AlignHCenter ? clockColumn.horizontalCenter : undefined
|
||||||
topMargin: 5
|
topMargin: 5
|
||||||
leftMargin: -5
|
leftMargin: -5
|
||||||
rightMargin: -5
|
rightMargin: -5
|
||||||
}
|
}
|
||||||
opacity: GlobalStates.screenLocked ? 1 : 0
|
opacity: GlobalStates.screenLocked ? 1 : 0
|
||||||
visible: opacity > 0
|
visible: opacity > 0
|
||||||
Behavior on opacity {
|
Behavior on opacity {
|
||||||
animation: Appearance.animation.elementMoveFast.numberAnimation.createObject(this)
|
animation: Appearance.animation.elementMoveFast.numberAnimation.createObject(this)
|
||||||
}
|
}
|
||||||
Item { Layout.fillWidth: bgRoot.textHorizontalAlignment !== Text.AlignLeft; implicitWidth: 1 }
|
Item { Layout.fillWidth: bgRoot.textHorizontalAlignment !== Text.AlignLeft; implicitWidth: 1 }
|
||||||
MaterialSymbol {
|
MaterialSymbol {
|
||||||
text: "lock"
|
text: "lock"
|
||||||
Layout.fillWidth: false
|
Layout.fillWidth: false
|
||||||
iconSize: Appearance.font.pixelSize.huge
|
iconSize: Appearance.font.pixelSize.huge
|
||||||
color: bgRoot.colText
|
color: bgRoot.colText
|
||||||
style: Text.Raised
|
style: Text.Raised
|
||||||
styleColor: Appearance.colors.colShadow
|
styleColor: Appearance.colors.colShadow
|
||||||
}
|
}
|
||||||
StyledText {
|
StyledText {
|
||||||
Layout.fillWidth: false
|
Layout.fillWidth: false
|
||||||
text: "Locked"
|
text: "Locked"
|
||||||
color: bgRoot.colText
|
color: bgRoot.colText
|
||||||
font.pixelSize: Appearance.font.pixelSize.larger
|
font.pixelSize: Appearance.font.pixelSize.larger
|
||||||
style: Text.Raised
|
style: Text.Raised
|
||||||
styleColor: Appearance.colors.colShadow
|
styleColor: Appearance.colors.colShadow
|
||||||
}
|
}
|
||||||
Item { Layout.fillWidth: bgRoot.textHorizontalAlignment !== Text.AlignRight; implicitWidth: 1 }
|
Item { Layout.fillWidth: bgRoot.textHorizontalAlignment !== Text.AlignRight; implicitWidth: 1 }
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -119,6 +119,7 @@ Singleton {
|
|||||||
property bool fixedClockPosition: false
|
property bool fixedClockPosition: false
|
||||||
property real clockX: -500
|
property real clockX: -500
|
||||||
property real clockY: -500
|
property real clockY: -500
|
||||||
|
property bool showClock: true
|
||||||
property string wallpaperPath: ""
|
property string wallpaperPath: ""
|
||||||
property string thumbnailPath: ""
|
property string thumbnailPath: ""
|
||||||
property JsonObject parallax: JsonObject {
|
property JsonObject parallax: JsonObject {
|
||||||
|
|||||||
@@ -69,6 +69,18 @@ ContentPage {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ContentSection {
|
||||||
|
title: Translation.tr("Background")
|
||||||
|
|
||||||
|
ConfigSwitch {
|
||||||
|
text: Translation.tr("Show clock")
|
||||||
|
checked: Config.options.background.showClock
|
||||||
|
onCheckedChanged: {
|
||||||
|
Config.options.background.showClock = checked;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ContentSection {
|
ContentSection {
|
||||||
title: Translation.tr("Bar")
|
title: Translation.tr("Bar")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user