forked from Shinonome/dots-hyprland
hefty: bar: time widget
This commit is contained in:
@@ -95,4 +95,15 @@ Singleton {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function findParentWithProperty(obj, propertyName) {
|
||||
let current = obj;
|
||||
while (current) {
|
||||
if (current.hasOwnProperty(propertyName)) {
|
||||
return current;
|
||||
}
|
||||
current = current.parent;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
pragma ComponentBehavior: Bound
|
||||
import QtQuick
|
||||
import qs.modules.common as C
|
||||
|
||||
Rectangle {
|
||||
id: root
|
||||
@@ -7,7 +8,7 @@ Rectangle {
|
||||
property bool hover: false
|
||||
property bool press: false
|
||||
property bool drag: false
|
||||
property color contentColor: Appearance.m3colors.m3onBackground
|
||||
property color contentColor: C.Appearance.m3colors.m3onBackground
|
||||
color: "transparent"
|
||||
|
||||
FadeLoader {
|
||||
@@ -15,9 +16,12 @@ Rectangle {
|
||||
anchors.fill: parent
|
||||
shown: root.hover
|
||||
sourceComponent: StateLayer {
|
||||
radius: root.radius
|
||||
state: StateLayer.State.Hover
|
||||
color: root.contentColor
|
||||
topLeftRadius: root.topLeftRadius
|
||||
topRightRadius: root.topRightRadius
|
||||
bottomLeftRadius: root.bottomLeftRadius
|
||||
bottomRightRadius: root.bottomRightRadius
|
||||
}
|
||||
}
|
||||
FadeLoader {
|
||||
@@ -25,9 +29,12 @@ Rectangle {
|
||||
anchors.fill: parent
|
||||
shown: root.focus
|
||||
sourceComponent: StateLayer {
|
||||
radius: root.radius
|
||||
state: StateLayer.State.Focus
|
||||
color: root.contentColor
|
||||
topLeftRadius: root.topLeftRadius
|
||||
topRightRadius: root.topRightRadius
|
||||
bottomLeftRadius: root.bottomLeftRadius
|
||||
bottomRightRadius: root.bottomRightRadius
|
||||
}
|
||||
}
|
||||
FadeLoader {
|
||||
@@ -35,9 +42,12 @@ Rectangle {
|
||||
anchors.fill: parent
|
||||
shown: root.press
|
||||
sourceComponent: StateLayer {
|
||||
radius: root.radius
|
||||
state: StateLayer.State.Press
|
||||
color: root.contentColor
|
||||
topLeftRadius: root.topLeftRadius
|
||||
topRightRadius: root.topRightRadius
|
||||
bottomLeftRadius: root.bottomLeftRadius
|
||||
bottomRightRadius: root.bottomRightRadius
|
||||
}
|
||||
}
|
||||
FadeLoader {
|
||||
@@ -45,9 +55,12 @@ Rectangle {
|
||||
anchors.fill: parent
|
||||
shown: root.drag
|
||||
sourceComponent: StateLayer {
|
||||
radius: root.radius
|
||||
state: StateLayer.State.Drag
|
||||
color: root.contentColor
|
||||
topLeftRadius: root.topLeftRadius
|
||||
topRightRadius: root.topRightRadius
|
||||
bottomLeftRadius: root.bottomLeftRadius
|
||||
bottomRightRadius: root.bottomRightRadius
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user