1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-04-30 09:32:05 -04:00
Files
DankMaterialShell/quickshell/Modules/Lock/KeyboardController.qml
bbedward f76724f7cd logger: add a dedicated QML logging Singleton
- adds log.info/error/debug/warn/fatal
- adds ability to write logs to any file
- add CLI options in addition to env to set log levels
2026-04-29 15:42:30 -04:00

42 lines
1.0 KiB
QML

pragma ComponentBehavior: Bound
import QtQuick
import qs.Services
Item {
id: keyboard_controller
readonly property var log: Log.scoped("KeyboardController")
// reference on the TextInput
property Item target
//Booléan on the state of the keyboard
property bool isKeyboardActive: false
property var rootObject
function show() {
if (!isKeyboardActive && keyboard === null) {
keyboard = keyboardComponent.createObject(keyboard_controller.rootObject);
keyboard.target = keyboard_controller.target;
keyboard.dismissed.connect(hide);
isKeyboardActive = true;
} else
log.debug("The keyboard is already shown");
}
function hide() {
if (isKeyboardActive && keyboard !== null) {
keyboard.destroy();
isKeyboardActive = false;
} else
log.debug("The keyboard is already hidden");
}
// private
property Item keyboard: null
Component {
id: keyboardComponent
Keyboard {}
}
}