import QtQuick
import Quickshell
import Quickshell.Hyprland
import Quickshell.Io


Item {  // container, invisible
    id: jLoader

    Loader {
        id: jLearnerLoader
        active: false
        sourceComponent: JLearner { id: jLearner }
    }

    GlobalShortcut {
        name: "JLearner"
        description: "Open Japanese Learner"

        onPressed: {
            console.log("Pressed Meta+Shift+J (Hyprland global shortcut)")
            jLearnerLoader.active = !jLearnerLoader.active
        }
    }

    function closeJLearner() {
        jLearnerLoader.active = false
    }
}