aboutsummaryrefslogtreecommitdiffstats
path: root/desktop/island/ClockPill.qml
diff options
context:
space:
mode:
Diffstat (limited to 'desktop/island/ClockPill.qml')
-rw-r--r--desktop/island/ClockPill.qml38
1 files changed, 36 insertions, 2 deletions
diff --git a/desktop/island/ClockPill.qml b/desktop/island/ClockPill.qml
index 93e840f..4ed8e38 100644
--- a/desktop/island/ClockPill.qml
+++ b/desktop/island/ClockPill.qml
@@ -14,16 +14,31 @@ import Quickshell.Widgets
import QtQuick
import ".."
import "../modules/vm"
+import "calendar"
import "Logic.js" as Logic
// Date and time at rest, with one dot per VM that is not plainly shut off.
// During a flick: the workspace's desktop icon, the app's icon and its name.
+// A click opens the calendar panel in this capsule.
Capsule {
id: pill
property bool flicking: false
property string flickWs: ""
property string flickApp: ""
+ property string panel: ""
+
+ signal openCalendar()
+ signal closeCalendar()
+
+ expanded: panel === "calendar"
+ panelWidth: 620
+ panelHeight: calendarPanel.implicitHeight + 28
+
+ // The island calls these: focus moves into the panel when it opens, and
+ // Escape asks the panel before closing it.
+ function focusPanel() { calendarPanel.reset(); calendarPanel.forceActiveFocus(); }
+ function back() { return calendarPanel.back(); }
readonly property var entry: flickApp ? DesktopEntries.heuristicLookup(flickApp) : null
readonly property string wsIcon: Workspaces.icon(flickWs)
@@ -42,7 +57,7 @@ Capsule {
id: restRow
anchors.centerIn: parent
spacing: 10
- opacity: pill.flicking ? 0 : 1
+ opacity: pill.flicking || pill.expanded ? 0 : 1
Behavior on opacity { NumberAnimation { duration: 150 } }
Text {
@@ -74,7 +89,7 @@ Capsule {
id: flickRow
anchors.centerIn: parent
spacing: 8
- opacity: pill.flicking ? 1 : 0
+ opacity: pill.flicking && !pill.expanded ? 1 : 0
Behavior on opacity { NumberAnimation { duration: 150 } }
// The desktop sits in a badge so it does not read as a second app
@@ -126,4 +141,23 @@ Capsule {
color: Theme.text
}
}
+
+ // At rest the whole pill is the button; open, the panel takes the clicks.
+ MouseArea {
+ anchors.fill: parent
+ enabled: !pill.expanded
+ cursorShape: Qt.PointingHandCursor
+ onClicked: pill.openCalendar()
+ }
+
+ CalendarPanel {
+ id: calendarPanel
+ x: 14
+ y: 14
+ width: pill.panelWidth - 28
+ opacity: pill.expanded ? 1 : 0
+ visible: opacity > 0
+ Behavior on opacity { NumberAnimation { duration: 160 } }
+ onCloseRequested: pill.closeCalendar()
+ }
}