forked from Shinonome/dots-hyprland
wbar: tray
This commit is contained in:
@@ -13,12 +13,23 @@ Loader {
|
||||
required property var contentItem
|
||||
property real padding: Looks.radius.large - Looks.radius.medium
|
||||
property bool noSmoothClosing: !Config.options.waffles.smootherAnimations
|
||||
property bool closeOnFocusLost: true
|
||||
signal focusCleared()
|
||||
|
||||
property Item anchorItem: parent
|
||||
property real visualMargin: 12
|
||||
readonly property bool barAtBottom: Config.options.waffles.bar.bottom
|
||||
property real ambientShadowWidth: 1
|
||||
|
||||
onFocusCleared: {
|
||||
if (!root.closeOnFocusLost) return;
|
||||
root.close()
|
||||
}
|
||||
|
||||
function grabFocus() { // Doesn't work
|
||||
item.grabFocus();
|
||||
}
|
||||
|
||||
function close() {
|
||||
item.close();
|
||||
}
|
||||
@@ -43,9 +54,7 @@ Loader {
|
||||
id: focusGrab
|
||||
active: true
|
||||
windows: [popupWindow]
|
||||
onCleared: {
|
||||
root.close()
|
||||
}
|
||||
onCleared: root.focusCleared();
|
||||
}
|
||||
|
||||
function close() {
|
||||
@@ -53,6 +62,10 @@ Loader {
|
||||
else closeAnim.start();
|
||||
}
|
||||
|
||||
function grabFocus() {
|
||||
focusGrab.active = true; // Doesn't work
|
||||
}
|
||||
|
||||
implicitWidth: realContent.implicitWidth + (ambientShadow.border.width * 2) + (root.visualMargin * 2)
|
||||
implicitHeight: realContent.implicitHeight + (ambientShadow.border.width * 2) + (root.visualMargin * 2)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user