mirror of
https://github.com/kossLAN/dots.git
synced 2025-11-05 06:59:50 -05:00
bar/systray: issue recreate on interact
This commit is contained in:
parent
e81df16f49
commit
f041f1d10f
3 changed files with 20 additions and 7 deletions
|
|
@ -29,11 +29,10 @@ RowLayout {
|
|||
hoverEnabled: true
|
||||
anchors.fill: parent
|
||||
onClicked: {
|
||||
// trayText.width = sysTrayContent.width - trayIcon.width - trayContainer.spacing;
|
||||
// trayText.visible = true;
|
||||
// root.popup.set(this, trayMenu);
|
||||
menuOpener.menu = trayField.modelData.menu;
|
||||
|
||||
if (root.popup.content == trayMenu) {
|
||||
root.popup.toggle()
|
||||
root.popup.hide();
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -44,7 +43,6 @@ RowLayout {
|
|||
|
||||
QsMenuOpener {
|
||||
id: menuOpener
|
||||
menu: trayField.modelData.menu
|
||||
}
|
||||
|
||||
WrapperItem {
|
||||
|
|
@ -62,6 +60,7 @@ RowLayout {
|
|||
id: sysTrayContent
|
||||
Layout.fillWidth: true
|
||||
Layout.fillHeight: true
|
||||
onInteracted: menuOpener.menu = null
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ import "../.."
|
|||
ColumnLayout {
|
||||
id: root
|
||||
required property QsMenuEntry modelData
|
||||
signal interacted
|
||||
|
||||
Rectangle {
|
||||
visible: (root.modelData?.isSeparator ?? false)
|
||||
|
|
@ -20,5 +21,6 @@ ColumnLayout {
|
|||
visible: !root.modelData?.isSeparator
|
||||
menuData: root.modelData
|
||||
Layout.fillWidth: true
|
||||
onInteracted: root.interacted()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ import "../.."
|
|||
ColumnLayout {
|
||||
id: root
|
||||
required property var menuData
|
||||
signal interacted
|
||||
|
||||
WrapperRectangle {
|
||||
Layout.fillWidth: true
|
||||
|
|
@ -31,10 +32,13 @@ ColumnLayout {
|
|||
if (!root.menuData?.enabled)
|
||||
return;
|
||||
|
||||
if (root.menuData?.hasChildren)
|
||||
if (root.menuData?.hasChildren) {
|
||||
subTrayMenu.visible = !subTrayMenu.visible;
|
||||
return;
|
||||
}
|
||||
|
||||
root.menuData?.triggered();
|
||||
root.interacted();
|
||||
}
|
||||
|
||||
RowLayout {
|
||||
|
|
@ -72,7 +76,7 @@ ColumnLayout {
|
|||
|
||||
Text {
|
||||
id: text
|
||||
text: (root.menuData?.text) ?? ""
|
||||
text: root.menuData?.text ?? ""
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
color: {
|
||||
let color = Qt.color(ShellSettings.settings.colors["inverse_surface"]);
|
||||
|
|
@ -88,6 +92,14 @@ ColumnLayout {
|
|||
|
||||
Layout.fillWidth: true
|
||||
Layout.fillHeight: true
|
||||
|
||||
Connections {
|
||||
target: root.menuData
|
||||
|
||||
function onTextChanged() {
|
||||
console.log("Hi");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Item {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue