forked from Shinonome/dots-hyprland
add secondDot , fix settings layout little more
This commit is contained in:
@@ -25,7 +25,7 @@ Item {
|
|||||||
property real centerDotSize: 10
|
property real centerDotSize: 10
|
||||||
property real hourDotSize: 12
|
property real hourDotSize: 12
|
||||||
property real centerGlowSize: 135
|
property real centerGlowSize: 135
|
||||||
|
property real secondDotSize: 20
|
||||||
|
|
||||||
|
|
||||||
property color colShadow: Appearance.colors.colShadow
|
property color colShadow: Appearance.colors.colShadow
|
||||||
@@ -35,11 +35,27 @@ Item {
|
|||||||
property color colMinuteHand: Appearance.colors.colSecondaryActive
|
property color colMinuteHand: Appearance.colors.colSecondaryActive
|
||||||
property color colOnHourHand: Appearance.colors.colOnPrimary
|
property color colOnHourHand: Appearance.colors.colOnPrimary
|
||||||
property color colTimeIndicators: Appearance.colors.colSecondaryContainerHover
|
property color colTimeIndicators: Appearance.colors.colSecondaryContainerHover
|
||||||
|
property color colSecondDot: Appearance.colors.colTertiary
|
||||||
readonly property list<string> clockNumbers: DateTime.time.split(/[: ]/)
|
readonly property list<string> clockNumbers: DateTime.time.split(/[: ]/)
|
||||||
readonly property int clockHour: parseInt(clockNumbers[0]) % 12
|
readonly property int clockHour: parseInt(clockNumbers[0]) % 12
|
||||||
readonly property int clockMinute: parseInt(clockNumbers[1])
|
readonly property int clockMinute: parseInt(clockNumbers[1])
|
||||||
|
|
||||||
|
property int clockSecond: 0
|
||||||
|
|
||||||
|
Loader{
|
||||||
|
active: Config.option.background.clock.cookie.secondDot
|
||||||
|
sourceComponent: Timer {
|
||||||
|
interval: 1000
|
||||||
|
running: true;repeat: true
|
||||||
|
onTriggered: {
|
||||||
|
var now = new Date()
|
||||||
|
clockSecond = now.getSeconds()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
implicitWidth: implicitSize
|
implicitWidth: implicitSize
|
||||||
implicitHeight: implicitSize
|
implicitHeight: implicitSize
|
||||||
|
|
||||||
@@ -134,6 +150,7 @@ Item {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Numbers column
|
||||||
Column {
|
Column {
|
||||||
id: timeIndicators
|
id: timeIndicators
|
||||||
z: 1
|
z: 1
|
||||||
@@ -187,6 +204,9 @@ Item {
|
|||||||
Item {
|
Item {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
z: 3
|
z: 3
|
||||||
|
Behavior on rotation{
|
||||||
|
animation: Appearance.animation.elementResize.numberAnimation.createObject(this)
|
||||||
|
}
|
||||||
rotation: -90 + (360 / 60) * root.clockMinute
|
rotation: -90 + (360 / 60) * root.clockMinute
|
||||||
Rectangle {
|
Rectangle {
|
||||||
Behavior on height {
|
Behavior on height {
|
||||||
@@ -226,6 +246,33 @@ Item {
|
|||||||
radius: implicitWidth / 2
|
radius: implicitWidth / 2
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Second dot
|
||||||
|
Item {
|
||||||
|
opacity: Config.options.background.clock.cookie.secondDot ? 1.0 : 0
|
||||||
|
Behavior on opacity {
|
||||||
|
animation: Appearance.animation.elementMoveFast.numberAnimation.createObject(this)
|
||||||
|
}
|
||||||
|
Behavior on rotation{
|
||||||
|
animation: Appearance.animation.elementMove.numberAnimation.createObject(this)
|
||||||
|
}
|
||||||
|
rotation: (360 / 60 * clockSecond) + 90 // +90 degrees to align with minute hand
|
||||||
|
anchors.fill: parent
|
||||||
|
Rectangle {
|
||||||
|
anchors {
|
||||||
|
left: parent.left
|
||||||
|
verticalCenter: parent.verticalCenter
|
||||||
|
leftMargin: 10
|
||||||
|
}
|
||||||
|
implicitWidth: root.secondDotSize
|
||||||
|
implicitHeight: implicitWidth
|
||||||
|
radius: implicitWidth / 2
|
||||||
|
color: colSecondDot
|
||||||
|
opacity: 1.0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Quote
|
// Quote
|
||||||
Rectangle{
|
Rectangle{
|
||||||
id: quoteBox
|
id: quoteBox
|
||||||
|
|||||||
@@ -136,6 +136,7 @@ Singleton {
|
|||||||
property bool minuteHandSizeAdjust: true
|
property bool minuteHandSizeAdjust: true
|
||||||
property bool centerGlow: true
|
property bool centerGlow: true
|
||||||
property bool waveAnimation: true
|
property bool waveAnimation: true
|
||||||
|
property bool secondDot: true
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ Item {
|
|||||||
var radius = root.implicitSize / 2 - root.amplitude
|
var radius = root.implicitSize / 2 - root.amplitude
|
||||||
for (var i = 0; i <= steps; i++) {
|
for (var i = 0; i <= steps; i++) {
|
||||||
var angle = (i / steps) * 2 * Math.PI
|
var angle = (i / steps) * 2 * Math.PI
|
||||||
var wave = waveAnimation ? Math.sin(angle * root.sides + Math.PI/2 + root.waveTime) * root.amplitude : Math.sin(angle * root.sides + Math.PI/2) * root.amplitude
|
var wave = waveAnimation ? Math.sin(angle * root.sides + Math.PI/2 - root.waveTime) * root.amplitude : Math.sin(angle * root.sides + Math.PI/2) * root.amplitude
|
||||||
var x = Math.cos(angle) * (radius + wave) + cx
|
var x = Math.cos(angle) * (radius + wave) + cx
|
||||||
var y = Math.sin(angle) * (radius + wave) + cy
|
var y = Math.sin(angle) * (radius + wave) + cy
|
||||||
points.push(Qt.point(x, y))
|
points.push(Qt.point(x, y))
|
||||||
|
|||||||
@@ -106,7 +106,7 @@ ContentPage {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ConfigRow{
|
ConfigRow{
|
||||||
enabled: Config.options.background.clock.style === "cookie"
|
enabled: Config.options.background.clock.style === "cookie"
|
||||||
|
|
||||||
@@ -126,6 +126,17 @@ ContentPage {
|
|||||||
Config.options.background.clock.cookie.minuteHandSizeAdjust = checked;
|
Config.options.background.clock.cookie.minuteHandSizeAdjust = checked;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
ConfigRow{
|
||||||
|
enabled: Config.options.background.clock.style === "cookie"
|
||||||
|
ConfigSwitch {
|
||||||
|
buttonIcon: "pace"
|
||||||
|
text: Translation.tr("Second dot")
|
||||||
|
checked: Config.options.background.clock.cookie.secondDot
|
||||||
|
onCheckedChanged: {
|
||||||
|
Config.options.background.clock.cookie.secondDot = checked;
|
||||||
|
}
|
||||||
|
}
|
||||||
ConfigSwitch {
|
ConfigSwitch {
|
||||||
buttonIcon: "waves"
|
buttonIcon: "waves"
|
||||||
text: Translation.tr("Wave animation")
|
text: Translation.tr("Wave animation")
|
||||||
|
|||||||
Reference in New Issue
Block a user