mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-04-12 16:52:10 -04:00
dankbar: Fix widget context focus w/Autohide enabled
This commit is contained in:
@@ -37,10 +37,18 @@ PanelWindow {
|
|||||||
desktopEntry = entry || null;
|
desktopEntry = entry || null;
|
||||||
|
|
||||||
visible = true;
|
visible = true;
|
||||||
|
|
||||||
|
if (targetScreen) {
|
||||||
|
TrayMenuManager.registerMenu(targetScreen.name, root);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function close() {
|
function close() {
|
||||||
visible = false;
|
visible = false;
|
||||||
|
|
||||||
|
if (root.screen) {
|
||||||
|
TrayMenuManager.unregisterMenu(root.screen.name);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
screen: null
|
screen: null
|
||||||
@@ -56,6 +64,19 @@ PanelWindow {
|
|||||||
bottom: true
|
bottom: true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Component.onDestruction: {
|
||||||
|
if (root.screen) {
|
||||||
|
TrayMenuManager.unregisterMenu(root.screen.name);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Connections {
|
||||||
|
target: PopoutManager
|
||||||
|
function onPopoutOpening() {
|
||||||
|
root.close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
id: menuContainer
|
id: menuContainer
|
||||||
|
|
||||||
|
|||||||
@@ -111,10 +111,18 @@ BasePill {
|
|||||||
edge = barEdge ?? "top";
|
edge = barEdge ?? "top";
|
||||||
|
|
||||||
visible = true;
|
visible = true;
|
||||||
|
|
||||||
|
if (contextMenuWindow.screen) {
|
||||||
|
TrayMenuManager.registerMenu(contextMenuWindow.screen.name, contextMenuWindow);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function closeMenu() {
|
function closeMenu() {
|
||||||
visible = false;
|
visible = false;
|
||||||
|
|
||||||
|
if (contextMenuWindow.screen) {
|
||||||
|
TrayMenuManager.unregisterMenu(contextMenuWindow.screen.name);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
screen: null
|
screen: null
|
||||||
@@ -130,6 +138,19 @@ BasePill {
|
|||||||
bottom: true
|
bottom: true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Component.onDestruction: {
|
||||||
|
if (contextMenuWindow.screen) {
|
||||||
|
TrayMenuManager.unregisterMenu(contextMenuWindow.screen.name);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Connections {
|
||||||
|
target: PopoutManager
|
||||||
|
function onPopoutOpening() {
|
||||||
|
contextMenuWindow.closeMenu();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
MouseArea {
|
MouseArea {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
acceptedButtons: Qt.LeftButton | Qt.RightButton | Qt.MiddleButton
|
acceptedButtons: Qt.LeftButton | Qt.RightButton | Qt.MiddleButton
|
||||||
|
|||||||
@@ -161,10 +161,18 @@ BasePill {
|
|||||||
edge = barEdge ?? "top";
|
edge = barEdge ?? "top";
|
||||||
|
|
||||||
visible = true;
|
visible = true;
|
||||||
|
|
||||||
|
if (contextMenuWindow.screen) {
|
||||||
|
TrayMenuManager.registerMenu(contextMenuWindow.screen.name, contextMenuWindow);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function closeMenu() {
|
function closeMenu() {
|
||||||
visible = false;
|
visible = false;
|
||||||
|
|
||||||
|
if (contextMenuWindow.screen) {
|
||||||
|
TrayMenuManager.unregisterMenu(contextMenuWindow.screen.name);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
screen: null
|
screen: null
|
||||||
@@ -180,6 +188,19 @@ BasePill {
|
|||||||
bottom: true
|
bottom: true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Component.onDestruction: {
|
||||||
|
if (contextMenuWindow.screen) {
|
||||||
|
TrayMenuManager.unregisterMenu(contextMenuWindow.screen.name);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Connections {
|
||||||
|
target: PopoutManager
|
||||||
|
function onPopoutOpening() {
|
||||||
|
contextMenuWindow.closeMenu();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
MouseArea {
|
MouseArea {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
z: 0
|
z: 0
|
||||||
|
|||||||
@@ -855,12 +855,20 @@ Item {
|
|||||||
edge = barEdge ?? "top";
|
edge = barEdge ?? "top";
|
||||||
isVisible = true;
|
isVisible = true;
|
||||||
visible = true;
|
visible = true;
|
||||||
|
|
||||||
|
if (screen) {
|
||||||
|
TrayMenuManager.registerMenu(screen.name, contextMenuWindow);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function close() {
|
function close() {
|
||||||
isVisible = false;
|
isVisible = false;
|
||||||
visible = false;
|
visible = false;
|
||||||
windowContextMenuLoader.active = false;
|
windowContextMenuLoader.active = false;
|
||||||
|
|
||||||
|
if (screen) {
|
||||||
|
TrayMenuManager.unregisterMenu(screen.name);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
implicitWidth: 100
|
implicitWidth: 100
|
||||||
@@ -879,6 +887,19 @@ Item {
|
|||||||
bottom: true
|
bottom: true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Component.onDestruction: {
|
||||||
|
if (screen) {
|
||||||
|
TrayMenuManager.unregisterMenu(screen.name);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Connections {
|
||||||
|
target: PopoutManager
|
||||||
|
function onPopoutOpening() {
|
||||||
|
contextMenuWindow.close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
MouseArea {
|
MouseArea {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
onClicked: contextMenuWindow.close()
|
onClicked: contextMenuWindow.close()
|
||||||
|
|||||||
Reference in New Issue
Block a user