summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlittleblack111 <littleblack11111@gmail.com>2025-10-04 15:43:02 +0800
committerlittleblack111 <littleblack11111@gmail.com>2025-10-04 15:43:02 +0800
commit1aed1c0b13fb5a7e3ec2f19b9ef1403623d18123 (patch)
treee0e1eb5c05ad95cfa7ad83e8dad2406a46d72783
parent0bdef4d722e947922b963ef42fdcc16dc1d7b1df (diff)
init
-rw-r--r--bar/Bar.qml65
-rw-r--r--bar/TimeDate.qml175
-rw-r--r--launcher/components/IComponent.qml0
3 files changed, 144 insertions, 96 deletions
diff --git a/bar/Bar.qml b/bar/Bar.qml
index 6a3ef3d..70a633c 100644
--- a/bar/Bar.qml
+++ b/bar/Bar.qml
@@ -114,7 +114,70 @@ Scope {
// Tray {
// id: tray
// }
- TimeDate {}
+ Item {
+ Layout.preferredWidth: timeDateCCWrapper.implicitWidth
+ Layout.preferredHeight: timeDateCCWrapper.implicitHeight
+ IRect {
+ id: timeDateCCWrapper
+ color: Colors.accent
+ radius: Style.rounding.large
+
+ anchors.fill: parent
+
+ implicitHeight: Bar.height - General.rectMargin
+ implicitWidth: timeDateCC.width + General.rectMargin * 2
+ RowLayout {
+ id: timeDateCC
+ property bool showcc: false
+ // width: childrenRect.width
+ // height: childrenRect.height
+ anchors.centerIn: parent
+
+ TimeDate {}
+ Item {
+ implicitWidth: timeDateCC.showcc ? ccLoader.width : 0
+ implicitHeight: timeDateCC.showcc ? ccLoader.height : 0
+ Loader {
+ id: ccLoader
+ active: timeDateCC.showcc
+ sourceComponent: Component {
+ Icon {
+ text: ""
+ SequentialAnimation {
+ running: true
+ NumberAnimation {
+ target: parent
+ property: "opacity"
+ from: 0
+ to: 1
+ duration: General.animationDuration / 2
+ easing.type: Easing.InOutQuad
+ }
+ }
+ }
+ }
+ }
+ Behavior on implicitWidth {
+ NumberAnimation {
+ duration: General.animationDuration / 4
+ easing.type: Easing.InOutQuad
+ }
+ }
+ }
+ }
+ }
+ MouseArea {
+ anchors.fill: parent
+ cursorShape: Qt.PointingHandCursor
+ hoverEnabled: true
+ onEntered: {
+ timeDateCC.showcc = true;
+ }
+ onExited: {
+ timeDateCC.showcc = false;
+ }
+ }
+ }
Network {}
// Temp {
// id: temp
diff --git a/bar/TimeDate.qml b/bar/TimeDate.qml
index 2716e6d..3f557c6 100644
--- a/bar/TimeDate.qml
+++ b/bar/TimeDate.qml
@@ -8,115 +8,100 @@ import qs.config
Item {
id: root
+ implicitWidth: layout.implicitWidth
+ implicitHeight: layout.implicitHeight
property bool isAlt: false
property bool isCollapsed: false
- implicitWidth: container.implicitWidth
- implicitHeight: container.implicitHeight - General.rectMargin
- IRect {
- id: container
- anchors {
- fill: parent
- centerIn: parent
- }
-
- // implicitWidth: !isAlt ? nonAlt.implicitWidth + General.rectMargin * 2 : alt.implicitWidth + General.rectMargin * 2
- implicitWidth: layout.width + General.rectMargin * 2
- implicitHeight: Bar.height
+ RowLayout {
+ id: layout
+ anchors.centerIn: parent
+ spacing: Bar.resourceIconTextSpacing
+ Loader {
+ sourceComponent: !root.isAlt ? main : alt
+ readonly property Component main: Component {
+ RowLayout {
+ id: root
+ property int h: Services.TimeDate.hours
+ property int m: Services.TimeDate.minutes
+ property int s: Services.TimeDate.seconds
- color: Colors.accent
- radius: Style.rounding.large
+ Item {
+ Layout.fillWidth: true
+ }
+ anchors.centerIn: parent
+ spacing: Bar.resourceIconTextSpacing
- RowLayout {
- id: layout
- anchors.centerIn: parent
- spacing: Bar.resourceIconTextSpacing
- Loader {
- sourceComponent: !root.isAlt ? main : alt
- readonly property Component main: Component {
+ Icon {
+ text: Icons.resource.clock[root.h - 1]
+ font.pixelSize: Style.font.size.larger
+ }
RowLayout {
- id: root
- property int h: Services.TimeDate.hours
- property int m: Services.TimeDate.minutes
- property int s: Services.TimeDate.seconds
-
- Item {
- Layout.fillWidth: true
- }
- anchors.centerIn: parent
- spacing: Bar.resourceIconTextSpacing
-
- Icon {
- text: Icons.resource.clock[root.h - 1]
- font.pixelSize: Style.font.size.larger
- }
- RowLayout {
- spacing: 0
- IText {
- animate: true
- text: (root.h >= 10 ? "" : "0") + root.h
- }
- IText {
- text: ":"
- renderType: Text.CurveRendering
- }
- IText {
- animate: true
- text: (root.m >= 10 ? "" : "0") + root.m
- }
- IText {
- text: ":"
- renderType: Text.CurveRendering
- }
- IText {
- animate: true
- text: (root.s >= 10 ? "" : "0") + root.s
- renderType: Text.QtRendering // it's not static and is rapidly updated
- }
- }
- Item {
- Layout.fillWidth: true
+ spacing: 0
+ IText {
+ animate: true
+ text: (root.h >= 10 ? "" : "0") + root.h
}
- SequentialAnimation {
- running: true
- NumberAnimation {
- target: parent
- property: "opacity"
- from: 0
- to: 1
- duration: General.animationDuration / 2
- }
+ IText {
+ text: ":"
+ renderType: Text.CurveRendering
}
- }
- }
- readonly property Component alt: Component {
- RowLayout {
- Item {
- Layout.fillWidth: true
+ IText {
+ animate: true
+ text: (root.m >= 10 ? "" : "0") + root.m
}
- anchors.centerIn: parent
- spacing: Bar.resourceIconTextSpacing
-
- Icon {
- text: Icons.resource.calendar
- font.pixelSize: Style.font.size.larger
+ IText {
+ text: ":"
+ renderType: Text.CurveRendering
}
IText {
animate: true
- text: Services.TimeDate.date
+ text: (root.s >= 10 ? "" : "0") + root.s
+ renderType: Text.QtRendering // it's not static and is rapidly updated
}
- Item {
- Layout.fillWidth: true
+ }
+ Item {
+ Layout.fillWidth: true
+ }
+ SequentialAnimation {
+ running: true
+ NumberAnimation {
+ target: parent
+ property: "opacity"
+ from: 0
+ to: 1
+ duration: General.animationDuration / 2
}
- SequentialAnimation {
- running: true
- NumberAnimation {
- target: parent
- property: "opacity"
- from: 0
- to: 1
- duration: General.animationDuration / 2
- }
+ }
+ }
+ }
+ readonly property Component alt: Component {
+ RowLayout {
+ Item {
+ Layout.fillWidth: true
+ }
+ anchors.centerIn: parent
+ spacing: Bar.resourceIconTextSpacing
+
+ Icon {
+ text: Icons.resource.calendar
+ font.pixelSize: Style.font.size.larger
+ }
+ IText {
+ animate: true
+ text: Services.TimeDate.date
+ }
+ Item {
+ Layout.fillWidth: true
+ }
+ SequentialAnimation {
+ running: true
+ NumberAnimation {
+ target: parent
+ property: "opacity"
+ from: 0
+ to: 1
+ duration: General.animationDuration / 2
}
}
}
diff --git a/launcher/components/IComponent.qml b/launcher/components/IComponent.qml
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/launcher/components/IComponent.qml