C++ / fmt (pull_request) Successful in 4s
JS/TS / fmt (pull_request) Successful in 20s
JS/TS / lint (pull_request) Successful in 22s
Python / static (pull_request) Successful in 57s
Rust / fmt (pull_request) Successful in 1m2s
C++ / build (pull_request) Successful in 2m10s
Rust / build (pull_request) Successful in 1m50s
Rust / clippy (pull_request) Successful in 1m25s
Python / verify (pull_request) Successful in 2m58s
C++ / clang-tidy (pull_request) Successful in 7m8s
152 lines
2.7 KiB
QML
152 lines
2.7 KiB
QML
pragma ComponentBehavior: Bound
|
|
|
|
import Quickshell
|
|
import Quickshell.Services.SystemTray
|
|
import QtQuick
|
|
import ZShell.Config
|
|
import qs.Components
|
|
|
|
Item {
|
|
id: root
|
|
|
|
readonly property Item current: currentPopout?.item ?? null
|
|
readonly property Popout currentPopout: content.children.find(c => c.shouldBeActive) ?? null
|
|
required property bool horizontal
|
|
required property PopoutState popouts
|
|
|
|
implicitHeight: (currentPopout?.implicitHeight ?? 0) + Tokens.padding.smaller * 2
|
|
implicitWidth: (currentPopout?.implicitWidth ?? 0) + Tokens.padding.smaller * 2
|
|
|
|
Item {
|
|
id: content
|
|
|
|
anchors.fill: parent
|
|
|
|
Popout {
|
|
name: "audio"
|
|
|
|
sourceComponent: AudioPopout {
|
|
wrapper: root.wrapper
|
|
}
|
|
}
|
|
|
|
Repeater {
|
|
model: ScriptModel {
|
|
values: [...SystemTray.items.values]
|
|
}
|
|
|
|
Popout {
|
|
id: trayMenu
|
|
|
|
required property int index
|
|
required property SystemTrayItem modelData
|
|
|
|
name: `traymenu${index}`
|
|
sourceComponent: trayMenuComponent
|
|
|
|
Connections {
|
|
function onHasCurrentChanged(): void {
|
|
if (root.popouts.hasCurrent && trayMenu.shouldBeActive) {
|
|
trayMenu.sourceComponent = null;
|
|
trayMenu.sourceComponent = trayMenuComponent;
|
|
}
|
|
}
|
|
|
|
target: root.popouts
|
|
}
|
|
|
|
Component {
|
|
id: trayMenuComponent
|
|
|
|
TrayMenuPopout {
|
|
popouts: root.popouts
|
|
trayItem: trayMenu.modelData.menu
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
Popout {
|
|
name: "upower"
|
|
|
|
sourceComponent: UPowerPopout {
|
|
horizontal: root.horizontal
|
|
}
|
|
}
|
|
|
|
Popout {
|
|
name: "network"
|
|
|
|
sourceComponent: NetworkPopout {
|
|
wrapper: root.popouts
|
|
}
|
|
}
|
|
|
|
Popout {
|
|
name: "updates"
|
|
|
|
sourceComponent: UpdatesPopout {
|
|
wrapper: root.popouts
|
|
}
|
|
}
|
|
}
|
|
|
|
component Popout: Loader {
|
|
id: popout
|
|
|
|
required property string name
|
|
readonly property bool shouldBeActive: root.popouts.currentName === name
|
|
|
|
active: false
|
|
anchors.centerIn: opacity === 1 ? undefined : parent
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
|
anchors.top: opacity === 1 ? parent.top : undefined
|
|
anchors.topMargin: Tokens.padding.smaller
|
|
opacity: 0
|
|
scale: 0.8
|
|
|
|
states: State {
|
|
name: "active"
|
|
when: popout.shouldBeActive
|
|
|
|
PropertyChanges {
|
|
popout.active: true
|
|
popout.opacity: 1
|
|
popout.scale: 1
|
|
}
|
|
}
|
|
transitions: [
|
|
Transition {
|
|
from: "active"
|
|
to: ""
|
|
|
|
SequentialAnimation {
|
|
Anim {
|
|
properties: "opacity,scale"
|
|
}
|
|
|
|
PropertyAction {
|
|
property: "active"
|
|
target: popout
|
|
}
|
|
}
|
|
},
|
|
Transition {
|
|
from: ""
|
|
to: "active"
|
|
|
|
SequentialAnimation {
|
|
PropertyAction {
|
|
property: "active"
|
|
target: popout
|
|
}
|
|
|
|
Anim {
|
|
properties: "opacity,scale"
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|
|
}
|