aboutsummaryrefslogtreecommitdiffstats
path: root/desktop/island/StatusPill.qml
diff options
context:
space:
mode:
Diffstat (limited to 'desktop/island/StatusPill.qml')
-rw-r--r--desktop/island/StatusPill.qml42
1 files changed, 36 insertions, 6 deletions
diff --git a/desktop/island/StatusPill.qml b/desktop/island/StatusPill.qml
index 5ab8f95..1b84ec1 100644
--- a/desktop/island/StatusPill.qml
+++ b/desktop/island/StatusPill.qml
@@ -16,9 +16,9 @@ import QtQuick
import ".."
import "Logic.js" as Logic
-// Volume icon, tray, layout flag. The volume icon is the only way into the
-// sound panel and has no other gesture; the tray is a plain tray; the flag
-// switches layout on scroll and ignores clicks.
+// Controls icon, volume icon, tray, layout flag. The controls and volume
+// icons open their panels in this capsule; the tray is a plain tray; the
+// flag switches layout on scroll and ignores clicks.
Capsule {
id: pill
@@ -28,14 +28,20 @@ Capsule {
property string panel: ""
signal openSound()
+ signal openControls()
signal openDrawer()
+ // A drawer page, from a control tile's right-click.
+ signal openPage(string page)
// Emitted just before a tray menu opens; the menu cannot report its close.
signal menuShown()
- expanded: panel === "sound"
+ expanded: panel !== ""
restWidth: restRow.implicitWidth + 24
panelWidth: 320
- panelHeight: soundPanel.implicitHeight + 28
+ panelHeight: (panel === "controls" ? controlsPanel.implicitHeight : soundPanel.implicitHeight) + 28
+
+ // Edit mode never outlives its panel.
+ onPanelChanged: controlsPanel.editing = false
Row {
id: restRow
@@ -48,6 +54,18 @@ Capsule {
IconImage {
anchors.verticalCenter: parent.verticalCenter
implicitSize: 18
+ source: Quickshell.iconPath("preferences-system", true)
+
+ MouseArea {
+ anchors.fill: parent
+ cursorShape: Qt.PointingHandCursor
+ onClicked: pill.openControls()
+ }
+ }
+
+ IconImage {
+ anchors.verticalCenter: parent.verticalCenter
+ implicitSize: 18
source: Quickshell.iconPath(Logic.volumeIcon(pill.sound.volume, pill.sound.muted), true)
MouseArea {
@@ -116,9 +134,21 @@ Capsule {
y: 14
width: pill.panelWidth - 28
sound: pill.sound
- opacity: pill.expanded ? 1 : 0
+ opacity: pill.panel === "sound" ? 1 : 0
visible: opacity > 0
Behavior on opacity { NumberAnimation { duration: 160 } }
onOpenDrawer: pill.openDrawer()
}
+
+ ControlsPanel {
+ id: controlsPanel
+ x: 14
+ y: 14
+ width: pill.panelWidth - 28
+ sound: pill.sound
+ opacity: pill.panel === "controls" ? 1 : 0
+ visible: opacity > 0
+ Behavior on opacity { NumberAnimation { duration: 160 } }
+ onOpenDrawer: page => pill.openPage(page)
+ }
}