bar: animate tray
This commit is contained in:
parent
0d5389a687
commit
4e41356d5c
1 changed files with 34 additions and 31 deletions
|
|
@ -7,47 +7,50 @@ import Quickshell.Services.SystemTray
|
|||
import QtQuick
|
||||
import Qt5Compat.GraphicalEffects
|
||||
|
||||
BoxLayout {
|
||||
id: root
|
||||
StyledRect {
|
||||
animate: true
|
||||
clip: true
|
||||
|
||||
Repeater {
|
||||
model: SystemTray.items
|
||||
BoxLayout {
|
||||
Repeater {
|
||||
model: SystemTray.items
|
||||
|
||||
MouseArea {
|
||||
id: item
|
||||
MouseArea {
|
||||
id: item
|
||||
|
||||
required property SystemTrayItem modelData
|
||||
required property SystemTrayItem modelData
|
||||
|
||||
acceptedButtons: Qt.LeftButton | Qt.RightButton
|
||||
width: Math.round(Appearance.font.size.large * 1.2)
|
||||
height: Math.round(Appearance.font.size.large * 1.2)
|
||||
acceptedButtons: Qt.LeftButton | Qt.RightButton
|
||||
width: Math.round(Appearance.font.size.large * 1.2)
|
||||
height: Math.round(Appearance.font.size.large * 1.2)
|
||||
|
||||
onClicked: event => {
|
||||
if (event.button === Qt.LeftButton)
|
||||
modelData.activate();
|
||||
else if (modelData.hasMenu)
|
||||
menu.open();
|
||||
}
|
||||
onClicked: event => {
|
||||
if (event.button === Qt.LeftButton)
|
||||
modelData.activate();
|
||||
else if (modelData.hasMenu)
|
||||
menu.open();
|
||||
}
|
||||
|
||||
QsMenuAnchor {
|
||||
id: menu
|
||||
QsMenuAnchor {
|
||||
id: menu
|
||||
|
||||
menu: item.modelData.menu
|
||||
anchor.window: QsWindow.window
|
||||
}
|
||||
menu: item.modelData.menu
|
||||
anchor.window: QsWindow.window
|
||||
}
|
||||
|
||||
IconImage {
|
||||
id: icon
|
||||
IconImage {
|
||||
id: icon
|
||||
|
||||
visible: false
|
||||
source: item.modelData.icon
|
||||
anchors.fill: parent
|
||||
}
|
||||
visible: false
|
||||
source: item.modelData.icon
|
||||
anchors.fill: parent
|
||||
}
|
||||
|
||||
ColorOverlay {
|
||||
anchors.fill: icon
|
||||
source: icon
|
||||
color: Appearance.colours.lavender
|
||||
ColorOverlay {
|
||||
anchors.fill: icon
|
||||
source: icon
|
||||
color: Appearance.colours.lavender
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue