45 lines
1.2 KiB
QML
45 lines
1.2 KiB
QML
pragma ComponentBehavior: Bound
|
|
import Quickshell
|
|
import Quickshell.Services.SystemTray
|
|
import Quickshell.Widgets
|
|
import QtQuick
|
|
import QtQuick.Layouts
|
|
import qs
|
|
import qs.settings
|
|
|
|
WrapperRectangle {
|
|
id: root
|
|
color: Colors.base01
|
|
visible: iconRepeater.count != 0
|
|
radius: Config.rounding
|
|
Layout.fillHeight: true
|
|
leftMargin: 8
|
|
rightMargin: 8
|
|
|
|
child: RowLayout {
|
|
id: iconlayout
|
|
Repeater {
|
|
id: iconRepeater
|
|
model: SystemTray.items
|
|
delegate: WrapperMouseArea {
|
|
id: iconWrapper
|
|
required property var modelData
|
|
child: IconImage {
|
|
source: iconWrapper.modelData.icon
|
|
implicitSize: 16
|
|
}
|
|
QsMenuAnchor {
|
|
id: menu
|
|
anchor.item: iconWrapper
|
|
menu: iconWrapper.modelData.menu
|
|
}
|
|
acceptedButtons: Qt.LeftButton | Qt.RightButton
|
|
onClicked: mouse => {
|
|
if (mouse.button == Qt.RightButton) {
|
|
menu.open();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|