Base for JLearner
This commit is contained in:
@@ -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
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -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
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -5,6 +5,7 @@ import Quickshell.Hyprland
|
|||||||
import QtQuick //for Text
|
import QtQuick //for Text
|
||||||
import "./modules/bar"
|
import "./modules/bar"
|
||||||
import "./modules/wp"
|
import "./modules/wp"
|
||||||
|
import "./modules/japanese"
|
||||||
|
|
||||||
ShellRoot {
|
ShellRoot {
|
||||||
id: root
|
id: root
|
||||||
@@ -14,5 +15,8 @@ ShellRoot {
|
|||||||
|
|
||||||
//Wallpaper picker
|
//Wallpaper picker
|
||||||
WallpaperPickerLoader {}
|
WallpaperPickerLoader {}
|
||||||
|
|
||||||
|
//Japanese Lerner
|
||||||
|
JLearnerLoader {}
|
||||||
|
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user