mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2025-12-08 06:25:37 -05:00
niri: close spotlight when closing overview
This commit is contained in:
@@ -22,8 +22,10 @@ DankModal {
|
|||||||
|
|
||||||
property bool spotlightOpen: false
|
property bool spotlightOpen: false
|
||||||
property alias spotlightContent: spotlightContentInstance
|
property alias spotlightContent: spotlightContentInstance
|
||||||
|
property bool openedFromOverview: false
|
||||||
|
|
||||||
function show() {
|
function show() {
|
||||||
|
openedFromOverview = false
|
||||||
spotlightOpen = true
|
spotlightOpen = true
|
||||||
open()
|
open()
|
||||||
|
|
||||||
@@ -55,6 +57,7 @@ DankModal {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function hide() {
|
function hide() {
|
||||||
|
openedFromOverview = false
|
||||||
spotlightOpen = false
|
spotlightOpen = false
|
||||||
close()
|
close()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,6 +11,15 @@ Scope {
|
|||||||
// Only show overlay when in overview and spotlight is not open
|
// Only show overlay when in overview and spotlight is not open
|
||||||
property bool overlayActive: NiriService.inOverview && !(PopoutService.spotlightModal?.spotlightOpen ?? false)
|
property bool overlayActive: NiriService.inOverview && !(PopoutService.spotlightModal?.spotlightOpen ?? false)
|
||||||
|
|
||||||
|
Connections {
|
||||||
|
target: NiriService
|
||||||
|
function onInOverviewChanged() {
|
||||||
|
if (!NiriService.inOverview && PopoutService.spotlightModal?.openedFromOverview) {
|
||||||
|
PopoutService.spotlightModal.hide()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Loader {
|
Loader {
|
||||||
id: niriOverlayLoader
|
id: niriOverlayLoader
|
||||||
active: NiriService.inOverview
|
active: NiriService.inOverview
|
||||||
@@ -93,6 +102,7 @@ Scope {
|
|||||||
Qt.callLater(() => {
|
Qt.callLater(() => {
|
||||||
if (PopoutService.spotlightModal) {
|
if (PopoutService.spotlightModal) {
|
||||||
if (event.text) {
|
if (event.text) {
|
||||||
|
PopoutService.spotlightModal.openedFromOverview = true
|
||||||
PopoutService.spotlightModal.showWithQuery(event.text.trim())
|
PopoutService.spotlightModal.showWithQuery(event.text.trim())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user