mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-01-24 21:42:51 -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.Io
|
||||
import Quickshell.Widgets
|
||||
import Quickshell.Hyprland
|
||||
import qs.Common
|
||||
import qs.Modals
|
||||
import qs.Modals.Clipboard
|
||||
@@ -455,20 +456,6 @@ ShellRoot {
|
||||
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() {
|
||||
if (notepadSlideoutVariants.instances.length === 0) {
|
||||
return null
|
||||
@@ -479,10 +466,13 @@ ShellRoot {
|
||||
}
|
||||
|
||||
var focusedScreen = getFocusedScreenName()
|
||||
if (focusedScreen) {
|
||||
var focusedInstance = getNotepadInstanceForScreen(focusedScreen)
|
||||
if (focusedInstance) {
|
||||
return focusedInstance
|
||||
if (focusedScreen && notepadSlideoutVariants.instances.length > 0) {
|
||||
for (var i = 0; i < notepadSlideoutVariants.instances.length; i++) {
|
||||
var loader = notepadSlideoutVariants.instances[i]
|
||||
if (loader.modelData && loader.modelData.name === focusedScreen) {
|
||||
loader.ensureLoaded()
|
||||
return loader.item
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user