Base for JLearner

This commit is contained in:
Hannes
2026-03-02 01:08:27 +01:00
parent 644d6b5d1f
commit 10e2a14e14
3 changed files with 79 additions and 0 deletions
+44
View File
@@ -0,0 +1,44 @@
import QtQuick
import Quickshell
import QtQuick.Controls
import Quickshell.Wayland
import Quickshell.Hyprland
import Quickshell.Io
import "../../colors"
PanelWindow {
id: learner
implicitWidth: screen.width * 0.75
implicitHeight: screen.height * 0.5
color: "transparent"
visible: true
focusable: true
FocusScope {
id: jLearnerScope
focus: true
Keys.onReleased: {
if (event.key === Qt.Key_Escape) {
console.log("Pressed Escape, closing JLearner")
jLearnerLoader.active = false
}
}
Rectangle {
anchors.fill: parent
color: "lightblue"
}
}
Rectangle {
anchors.fill: parent
radius: 10
color: Qt.alpha(Colors.surfaceContainerLowest, 0.5)
border.width: 2
border.color: Colors.outlineVariant
clip: true
}
}
+31
View File
@@ -0,0 +1,31 @@
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: {
// generateThumbs.startDetached()
// generateThumbs.running = true
jLearnerLoader.active = !jLearnerLoader.active
console.log("Pressed Meta+Shift+J (Hyprland global shortcut)")
}
}
function closeJLearner() {
jLearnerLoader.active = false
}
}