forgot tray
This commit is contained in:
parent
0f8929c55a
commit
7aae19e8e0
4 changed files with 107 additions and 1 deletions
|
|
@ -41,6 +41,7 @@ Variants {
|
||||||
Mpris {}
|
Mpris {}
|
||||||
Bat {}
|
Bat {}
|
||||||
Pw {}
|
Pw {}
|
||||||
|
Tray {}
|
||||||
WallPicker {screenHeight: root.screen.height}
|
WallPicker {screenHeight: root.screen.height}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
52
modules/bar/Tray.qml
Normal file
52
modules/bar/Tray.qml
Normal file
|
|
@ -0,0 +1,52 @@
|
||||||
|
pragma ComponentBehavior: Bound
|
||||||
|
import Quickshell
|
||||||
|
import Quickshell.Services.SystemTray
|
||||||
|
import Quickshell.Widgets
|
||||||
|
import QtQuick
|
||||||
|
import QtQuick.Layouts
|
||||||
|
import QtQuick.Effects
|
||||||
|
import qs
|
||||||
|
import qs.settings
|
||||||
|
import qs.widgets
|
||||||
|
|
||||||
|
BarComponent {
|
||||||
|
id: root
|
||||||
|
visible: iconRepeater.count != 0
|
||||||
|
implicitHeight: Config.moduleHeight
|
||||||
|
implicitWidth: iconlayout.width + 16
|
||||||
|
|
||||||
|
RowLayout {
|
||||||
|
id: iconlayout
|
||||||
|
anchors.centerIn: root
|
||||||
|
spacing: 8
|
||||||
|
Repeater {
|
||||||
|
id: iconRepeater
|
||||||
|
model: SystemTray.items
|
||||||
|
delegate: Item {
|
||||||
|
id: iconWrapper
|
||||||
|
required property var modelData
|
||||||
|
implicitWidth: 16
|
||||||
|
implicitHeight: 16
|
||||||
|
IconImage {
|
||||||
|
anchors.centerIn: parent
|
||||||
|
source: iconWrapper.modelData.icon
|
||||||
|
implicitSize: 16
|
||||||
|
}
|
||||||
|
QsMenuAnchor {
|
||||||
|
id: menu
|
||||||
|
anchor.item: iconWrapper
|
||||||
|
menu: iconWrapper.modelData.menu
|
||||||
|
}
|
||||||
|
MouseArea {
|
||||||
|
anchors.fill: parent
|
||||||
|
acceptedButtons: Qt.LeftButton | Qt.RightButton
|
||||||
|
onClicked: mouse => {
|
||||||
|
if (mouse.button == Qt.RightButton) {
|
||||||
|
menu.open();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
53
modules/bar/Tray.qml~
Normal file
53
modules/bar/Tray.qml~
Normal file
|
|
@ -0,0 +1,53 @@
|
||||||
|
pragma ComponentBehavior: Bound
|
||||||
|
import Quickshell
|
||||||
|
import Quickshell.Services.SystemTray
|
||||||
|
import Quickshell.Widgets
|
||||||
|
import QtQuick
|
||||||
|
import QtQuick.Layouts
|
||||||
|
import QtQuick.Effects
|
||||||
|
import qs
|
||||||
|
import qs.settings
|
||||||
|
|
||||||
|
BarComponent {
|
||||||
|
id: root
|
||||||
|
visible: iconRepeater.count != 0
|
||||||
|
implicitHeight: Config.moduleHeight
|
||||||
|
implicitWidth: iconlayout.width + 16
|
||||||
|
color: Colors.moduleBg
|
||||||
|
radius: Config.rounding
|
||||||
|
|
||||||
|
RowLayout {
|
||||||
|
id: iconlayout
|
||||||
|
anchors.centerIn: root
|
||||||
|
spacing: 8
|
||||||
|
Repeater {
|
||||||
|
id: iconRepeater
|
||||||
|
model: SystemTray.items
|
||||||
|
delegate: Item {
|
||||||
|
id: iconWrapper
|
||||||
|
required property var modelData
|
||||||
|
implicitWidth: 16
|
||||||
|
implicitHeight: 16
|
||||||
|
IconImage {
|
||||||
|
anchors.centerIn: parent
|
||||||
|
source: iconWrapper.modelData.icon
|
||||||
|
implicitSize: 16
|
||||||
|
}
|
||||||
|
QsMenuAnchor {
|
||||||
|
id: menu
|
||||||
|
anchor.item: iconWrapper
|
||||||
|
menu: iconWrapper.modelData.menu
|
||||||
|
}
|
||||||
|
MouseArea {
|
||||||
|
anchors.fill: parent
|
||||||
|
acceptedButtons: Qt.LeftButton | Qt.RightButton
|
||||||
|
onClicked: mouse => {
|
||||||
|
if (mouse.button == Qt.RightButton) {
|
||||||
|
menu.open();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -3,7 +3,7 @@ barHeight=30
|
||||||
floating=false
|
floating=false
|
||||||
font=Iosevka
|
font=Iosevka
|
||||||
fontSize=16
|
fontSize=16
|
||||||
iconSize=14
|
iconSize=12
|
||||||
opacity=1
|
opacity=1
|
||||||
primaryMon=eDP-1
|
primaryMon=eDP-1
|
||||||
rounding=16
|
rounding=16
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue