Initial Notification Daemon Impl
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
|
||||
pragma ComponentBehavior: Bound
|
||||
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import Quickshell
|
||||
@@ -8,7 +10,7 @@ import qs.Common
|
||||
|
||||
WrapperRectangle {
|
||||
id: systrayRoot
|
||||
property var monitor: ""
|
||||
property string monitor: ""
|
||||
rightMargin: Theme.gaps
|
||||
leftMargin: Theme.gaps
|
||||
radius: 25
|
||||
@@ -17,13 +19,16 @@ WrapperRectangle {
|
||||
|
||||
// color: Theme.backgroudColor
|
||||
RowLayout {
|
||||
Layout.alignment: Qt.AlignVCenter | Qt.AlignHCenter
|
||||
property var monitor: parent.monitor
|
||||
Layout.alignment: Qt.AlignVCenter | Qt.AlignHCenter
|
||||
Repeater {
|
||||
property string monitor: parent.monitor
|
||||
model: SystemTray.items.values
|
||||
delegate: Rectangle {
|
||||
id: systrayItem
|
||||
|
||||
required property var modelData
|
||||
property string monitor: parent.monitor
|
||||
property var model: modelData
|
||||
property string iconSource: {
|
||||
let icon = systrayItem.model && systrayItem.model.icon;
|
||||
@@ -52,7 +57,7 @@ WrapperRectangle {
|
||||
anchors.verticalCenter:parent.verticalCenter
|
||||
anchors.horizontalCenter:parent.horizontalCenter
|
||||
width:25; height:25
|
||||
source: iconSource
|
||||
source: systrayItem.iconSource
|
||||
}
|
||||
|
||||
|
||||
@@ -64,10 +69,8 @@ WrapperRectangle {
|
||||
|
||||
const globalPos = mapToGlobal(0, 0);
|
||||
|
||||
const currentScreen = systrayRoot.monitor
|
||||
const screenX = currentScreen.x || 0;
|
||||
console.log(screenX)
|
||||
const relativeX = globalPos.x - screenX;
|
||||
const currentScreen = parent.monitor
|
||||
const relativeX = globalPos.x;
|
||||
menuAnchor.menu = systrayItem.model.menu;
|
||||
menuAnchor.anchor.window = root;
|
||||
menuAnchor.anchor.rect = Qt.rect(
|
||||
|
||||
Reference in New Issue
Block a user