mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-01-31 08:52:49 -05:00
Fix Notepad on Hyprland due to missing import (#195)
This commit is contained in:
26
shell.qml
26
shell.qml
@@ -4,6 +4,7 @@ import QtQuick
|
|||||||
import Quickshell
|
import Quickshell
|
||||||
import Quickshell.Io
|
import Quickshell.Io
|
||||||
import Quickshell.Widgets
|
import Quickshell.Widgets
|
||||||
|
import Quickshell.Hyprland
|
||||||
import qs.Common
|
import qs.Common
|
||||||
import qs.Modals
|
import qs.Modals
|
||||||
import qs.Modals.Clipboard
|
import qs.Modals.Clipboard
|
||||||
@@ -455,20 +456,6 @@ ShellRoot {
|
|||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
|
||||||
function getNotepadInstanceForScreen(screenName: string) {
|
|
||||||
if (!screenName || notepadSlideoutVariants.instances.length === 0) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
for (var i = 0; i < notepadSlideoutVariants.instances.length; i++) {
|
|
||||||
var loader = notepadSlideoutVariants.instances[i]
|
|
||||||
if (loader.modelData && loader.modelData.name === screenName) {
|
|
||||||
loader.ensureLoaded()
|
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function getActiveNotepadInstance() {
|
function getActiveNotepadInstance() {
|
||||||
if (notepadSlideoutVariants.instances.length === 0) {
|
if (notepadSlideoutVariants.instances.length === 0) {
|
||||||
return null
|
return null
|
||||||
@@ -479,10 +466,13 @@ ShellRoot {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var focusedScreen = getFocusedScreenName()
|
var focusedScreen = getFocusedScreenName()
|
||||||
if (focusedScreen) {
|
if (focusedScreen && notepadSlideoutVariants.instances.length > 0) {
|
||||||
var focusedInstance = getNotepadInstanceForScreen(focusedScreen)
|
for (var i = 0; i < notepadSlideoutVariants.instances.length; i++) {
|
||||||
if (focusedInstance) {
|
var loader = notepadSlideoutVariants.instances[i]
|
||||||
return focusedInstance
|
if (loader.modelData && loader.modelData.name === focusedScreen) {
|
||||||
|
loader.ensureLoaded()
|
||||||
|
return loader.item
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user