forked from Shinonome/dots-hyprland
use camelCase and unload instead of hiding
This commit is contained in:
@@ -215,108 +215,111 @@ Variants {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// The clock
|
// The clock
|
||||||
Item {
|
Loader {
|
||||||
id: clock
|
active: Config.options.background.showClock
|
||||||
visible: Config.options.background.show_clock
|
sourceComponent: Item {
|
||||||
anchors {
|
id: clock
|
||||||
left: wallpaper.left
|
visible: Config.options.background.show_clock
|
||||||
top: wallpaper.top
|
|
||||||
leftMargin: bgRoot.movableXSpace + ((root.fixedClockPosition ? root.fixedClockX : bgRoot.clockX * bgRoot.effectiveWallpaperScale) - implicitWidth / 2)
|
|
||||||
topMargin: bgRoot.movableYSpace + ((root.fixedClockPosition ? root.fixedClockY : bgRoot.clockY * bgRoot.effectiveWallpaperScale) - implicitHeight / 2)
|
|
||||||
Behavior on leftMargin {
|
|
||||||
animation: Appearance.animation.elementMove.numberAnimation.createObject(this)
|
|
||||||
}
|
|
||||||
Behavior on topMargin {
|
|
||||||
animation: Appearance.animation.elementMove.numberAnimation.createObject(this)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
implicitWidth: clockColumn.implicitWidth
|
|
||||||
implicitHeight: clockColumn.implicitHeight
|
|
||||||
|
|
||||||
ColumnLayout {
|
|
||||||
id: clockColumn
|
|
||||||
anchors.centerIn: parent
|
|
||||||
spacing: 6
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
Layout.fillWidth: true
|
|
||||||
horizontalAlignment: bgRoot.textHorizontalAlignment
|
|
||||||
font {
|
|
||||||
family: Appearance.font.family.expressive
|
|
||||||
pixelSize: 90
|
|
||||||
weight: Font.Bold
|
|
||||||
}
|
|
||||||
color: bgRoot.colText
|
|
||||||
style: Text.Raised
|
|
||||||
styleColor: Appearance.colors.colShadow
|
|
||||||
text: DateTime.time
|
|
||||||
}
|
|
||||||
StyledText {
|
|
||||||
Layout.fillWidth: true
|
|
||||||
Layout.topMargin: -5
|
|
||||||
horizontalAlignment: bgRoot.textHorizontalAlignment
|
|
||||||
font {
|
|
||||||
family: Appearance.font.family.expressive
|
|
||||||
pixelSize: 20
|
|
||||||
weight: Font.DemiBold
|
|
||||||
}
|
|
||||||
color: bgRoot.colText
|
|
||||||
style: Text.Raised
|
|
||||||
styleColor: Appearance.colors.colShadow
|
|
||||||
text: DateTime.date
|
|
||||||
animateChange: true
|
|
||||||
}
|
|
||||||
StyledText {
|
|
||||||
Layout.fillWidth: true
|
|
||||||
horizontalAlignment: bgRoot.textHorizontalAlignment
|
|
||||||
font {
|
|
||||||
family: Appearance.font.family.expressive
|
|
||||||
pixelSize: 20
|
|
||||||
weight: Font.DemiBold
|
|
||||||
}
|
|
||||||
color: bgRoot.colText
|
|
||||||
style: Text.Raised
|
|
||||||
visible: Config.options.background.mantra !== ""
|
|
||||||
styleColor: Appearance.colors.colShadow
|
|
||||||
text: Config.options.background.mantra
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
RowLayout {
|
|
||||||
anchors {
|
anchors {
|
||||||
top: clockColumn.bottom
|
left: wallpaper.left
|
||||||
left: bgRoot.textHorizontalAlignment === Text.AlignLeft ? clockColumn.left : undefined
|
top: wallpaper.top
|
||||||
right: bgRoot.textHorizontalAlignment === Text.AlignRight ? clockColumn.right : undefined
|
leftMargin: bgRoot.movableXSpace + ((root.fixedClockPosition ? root.fixedClockX : bgRoot.clockX * bgRoot.effectiveWallpaperScale) - implicitWidth / 2)
|
||||||
horizontalCenter: bgRoot.textHorizontalAlignment === Text.AlignHCenter ? clockColumn.horizontalCenter : undefined
|
topMargin: bgRoot.movableYSpace + ((root.fixedClockPosition ? root.fixedClockY : bgRoot.clockY * bgRoot.effectiveWallpaperScale) - implicitHeight / 2)
|
||||||
topMargin: 5
|
Behavior on leftMargin {
|
||||||
leftMargin: -5
|
animation: Appearance.animation.elementMove.numberAnimation.createObject(this)
|
||||||
rightMargin: -5
|
}
|
||||||
|
Behavior on topMargin {
|
||||||
|
animation: Appearance.animation.elementMove.numberAnimation.createObject(this)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
opacity: GlobalStates.screenLocked ? 1 : 0
|
|
||||||
visible: opacity > 0
|
|
||||||
Behavior on opacity {
|
|
||||||
animation: Appearance.animation.elementMoveFast.numberAnimation.createObject(this)
|
|
||||||
}
|
|
||||||
Item { Layout.fillWidth: bgRoot.textHorizontalAlignment !== Text.AlignLeft; implicitWidth: 1 }
|
|
||||||
MaterialSymbol {
|
|
||||||
text: "lock"
|
|
||||||
Layout.fillWidth: false
|
|
||||||
iconSize: Appearance.font.pixelSize.huge
|
|
||||||
color: bgRoot.colText
|
|
||||||
style: Text.Raised
|
|
||||||
styleColor: Appearance.colors.colShadow
|
|
||||||
}
|
|
||||||
StyledText {
|
|
||||||
Layout.fillWidth: false
|
|
||||||
text: "Locked"
|
|
||||||
color: bgRoot.colText
|
|
||||||
font.pixelSize: Appearance.font.pixelSize.larger
|
|
||||||
style: Text.Raised
|
|
||||||
styleColor: Appearance.colors.colShadow
|
|
||||||
}
|
|
||||||
Item { Layout.fillWidth: bgRoot.textHorizontalAlignment !== Text.AlignRight; implicitWidth: 1 }
|
|
||||||
|
|
||||||
|
implicitWidth: clockColumn.implicitWidth
|
||||||
|
implicitHeight: clockColumn.implicitHeight
|
||||||
|
|
||||||
|
ColumnLayout {
|
||||||
|
id: clockColumn
|
||||||
|
anchors.centerIn: parent
|
||||||
|
spacing: 6
|
||||||
|
|
||||||
|
StyledText {
|
||||||
|
Layout.fillWidth: true
|
||||||
|
horizontalAlignment: bgRoot.textHorizontalAlignment
|
||||||
|
font {
|
||||||
|
family: Appearance.font.family.expressive
|
||||||
|
pixelSize: 90
|
||||||
|
weight: Font.Bold
|
||||||
|
}
|
||||||
|
color: bgRoot.colText
|
||||||
|
style: Text.Raised
|
||||||
|
styleColor: Appearance.colors.colShadow
|
||||||
|
text: DateTime.time
|
||||||
|
}
|
||||||
|
StyledText {
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Layout.topMargin: -5
|
||||||
|
horizontalAlignment: bgRoot.textHorizontalAlignment
|
||||||
|
font {
|
||||||
|
family: Appearance.font.family.expressive
|
||||||
|
pixelSize: 20
|
||||||
|
weight: Font.DemiBold
|
||||||
|
}
|
||||||
|
color: bgRoot.colText
|
||||||
|
style: Text.Raised
|
||||||
|
styleColor: Appearance.colors.colShadow
|
||||||
|
text: DateTime.date
|
||||||
|
animateChange: true
|
||||||
|
}
|
||||||
|
StyledText {
|
||||||
|
Layout.fillWidth: true
|
||||||
|
horizontalAlignment: bgRoot.textHorizontalAlignment
|
||||||
|
font {
|
||||||
|
family: Appearance.font.family.expressive
|
||||||
|
pixelSize: 20
|
||||||
|
weight: Font.DemiBold
|
||||||
|
}
|
||||||
|
color: bgRoot.colText
|
||||||
|
style: Text.Raised
|
||||||
|
visible: Config.options.background.mantra !== ""
|
||||||
|
styleColor: Appearance.colors.colShadow
|
||||||
|
text: Config.options.background.mantra
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
RowLayout {
|
||||||
|
anchors {
|
||||||
|
top: clockColumn.bottom
|
||||||
|
left: bgRoot.textHorizontalAlignment === Text.AlignLeft ? clockColumn.left : undefined
|
||||||
|
right: bgRoot.textHorizontalAlignment === Text.AlignRight ? clockColumn.right : undefined
|
||||||
|
horizontalCenter: bgRoot.textHorizontalAlignment === Text.AlignHCenter ? clockColumn.horizontalCenter : undefined
|
||||||
|
topMargin: 5
|
||||||
|
leftMargin: -5
|
||||||
|
rightMargin: -5
|
||||||
|
}
|
||||||
|
opacity: GlobalStates.screenLocked ? 1 : 0
|
||||||
|
visible: opacity > 0
|
||||||
|
Behavior on opacity {
|
||||||
|
animation: Appearance.animation.elementMoveFast.numberAnimation.createObject(this)
|
||||||
|
}
|
||||||
|
Item { Layout.fillWidth: bgRoot.textHorizontalAlignment !== Text.AlignLeft; implicitWidth: 1 }
|
||||||
|
MaterialSymbol {
|
||||||
|
text: "lock"
|
||||||
|
Layout.fillWidth: false
|
||||||
|
iconSize: Appearance.font.pixelSize.huge
|
||||||
|
color: bgRoot.colText
|
||||||
|
style: Text.Raised
|
||||||
|
styleColor: Appearance.colors.colShadow
|
||||||
|
}
|
||||||
|
StyledText {
|
||||||
|
Layout.fillWidth: false
|
||||||
|
text: "Locked"
|
||||||
|
color: bgRoot.colText
|
||||||
|
font.pixelSize: Appearance.font.pixelSize.larger
|
||||||
|
style: Text.Raised
|
||||||
|
styleColor: Appearance.colors.colShadow
|
||||||
|
}
|
||||||
|
Item { Layout.fillWidth: bgRoot.textHorizontalAlignment !== Text.AlignRight; implicitWidth: 1 }
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -119,7 +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 show_clock: true
|
property bool showClock: true
|
||||||
property string wallpaperPath: ""
|
property string wallpaperPath: ""
|
||||||
property string thumbnailPath: ""
|
property string thumbnailPath: ""
|
||||||
property JsonObject parallax: JsonObject {
|
property JsonObject parallax: JsonObject {
|
||||||
|
|||||||
@@ -630,9 +630,9 @@ ContentPage {
|
|||||||
|
|
||||||
ConfigSwitch {
|
ConfigSwitch {
|
||||||
text: Translation.tr("Show clock")
|
text: Translation.tr("Show clock")
|
||||||
checked: Config.options.background.show_clock
|
checked: Config.options.background.showClock
|
||||||
onCheckedChanged: {
|
onCheckedChanged: {
|
||||||
Config.options.background.show_clock = checked;
|
Config.options.background.showClock = checked;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user