mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-04-30 09:32:05 -04:00
- 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
42 lines
1.0 KiB
QML
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 {}
|
|
}
|
|
}
|