-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.qml
70 lines (63 loc) · 1.81 KB
/
main.qml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
import QtQuick 2.12
import QtQuick.Window 2.12
import QtQuick.Layouts 1.12
Window
{
id: root
width: Screen.width - 1 // Multimonitor fix
height: Screen.height - 1 // Multimonitor fix
color: settings.get("background/bgcolor", "#000000")
title: qsTr("QDMenu")
visible: true
visibility: Window.FullScreen
flags: Qt.FramelessWindowHint | Qt.WA_TranslucentBackground | Qt.WindowStaysOnTopHint
opacity: 0
function executeApp(input) {
const app = applist.current()
if (app) app.run(input)
}
onActiveChanged: {
if (!active) {
// console.log('Lost focus, exiting.')
// Qt.quit()
}
}
NumberAnimation on opacity {
from: 0
to: 1
duration: 500
running: true
}
ColumnLayout
{
anchors.fill: parent
width: parent.width
height: parent.height
spacing: 8
anchors.margins: 16
CommandInput
{
Layout.topMargin: settings.get("background/topmargin", 16)
Layout.alignment: Qt.AlignCenter
Layout.preferredWidth: parent.width / 4
Layout.preferredHeight: settings.getNumber("input/height", 32)
onItemSelected: executeApp(text)
onMoveUp: applist.up()
onMoveDown: applist.down()
onMoveLeft: applist.left()
onMoveRight: applist.right()
onMoveHome: applist.home()
onMoveEnd: applist.end()
onSearchChanged: applist.filter(text)
onToggleNoDisplay: applist.toggleNoDisplay()
}
AppList
{
id: applist
Layout.preferredWidth: parent.width
Layout.fillWidth: true
Layout.fillHeight: true
onItemSelected: executeApp("")
}
}
}