fix up Tray.qml because it used retarded logic before
This commit is contained in:
parent
ecbced9365
commit
6107b30a64
2 changed files with 17 additions and 11 deletions
|
|
@ -7,15 +7,13 @@ import QtQuick.Layouts
|
|||
import qs
|
||||
import qs.settings
|
||||
|
||||
Rectangle {
|
||||
Item {
|
||||
id: root
|
||||
color: Colors.base01
|
||||
visible: iconRepeater.count != 0
|
||||
radius: Config.rounding
|
||||
Layout.fillHeight: true
|
||||
required property double moduleHeight
|
||||
implicitHeight: moduleHeight
|
||||
implicitWidth: iconlayout.implicitWidth + 16
|
||||
implicitWidth: iconlayout.implicitWidth
|
||||
|
||||
RowLayout {
|
||||
id: iconlayout
|
||||
|
|
@ -23,10 +21,15 @@ Rectangle {
|
|||
Repeater {
|
||||
id: iconRepeater
|
||||
model: SystemTray.items
|
||||
delegate: WrapperMouseArea {
|
||||
delegate: Rectangle {
|
||||
id: iconWrapper
|
||||
color: Colors.base01
|
||||
required property var modelData
|
||||
child: IconImage {
|
||||
implicitWidth: root.moduleHeight + 8
|
||||
implicitHeight: root.moduleHeight
|
||||
radius: Config.rounding
|
||||
IconImage {
|
||||
anchors.centerIn: parent
|
||||
source: iconWrapper.modelData.icon
|
||||
implicitSize: 16
|
||||
}
|
||||
|
|
@ -35,10 +38,13 @@ Rectangle {
|
|||
anchor.item: iconWrapper
|
||||
menu: iconWrapper.modelData.menu
|
||||
}
|
||||
acceptedButtons: Qt.LeftButton | Qt.RightButton
|
||||
onClicked: mouse => {
|
||||
if (mouse.button == Qt.RightButton) {
|
||||
menu.open();
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
acceptedButtons: Qt.LeftButton | Qt.RightButton
|
||||
onClicked: mouse => {
|
||||
if (mouse.button == Qt.RightButton) {
|
||||
menu.open();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue