forked from johanhelsing/qtws17-compositor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.qml
139 lines (134 loc) · 5.68 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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
import QtQuick 2.8
import QtQuick.Window 2.2
import QtWayland.Compositor 1.0
import QtQuick.Controls 2.2
import QtQuick.Layouts 1.3
WaylandCompositor {
id: rootCompositor
socketName: "wayland-qt-presentation"
ListModel { id: shellSurfaces }
function runApplication(application, environment, workingDirectory) {
environment = environment || {};
environment.WAYLAND_DISPLAY = environment.WAYLAND_DISPLAY || rootCompositor.socketName;
var cmd = "";
for (var envVar in environment) {
cmd += "env " + envVar + "=" + environment[envVar] + " ";
}
cmd += application;
console.log("Running command: " + cmd);
return processEngine.run(cmd, workingDirectory || settings.srcDir);
}
WaylandOutput {
sizeFollowsWindow: true
window: Window {
id: presentationWindow
Shortcut { sequence: "ctrl+f"; onActivated: presentationWindow.toggleFullscreen() }
function toggleFullscreen() {
visibility = visibility === Window.FullScreen ? Window.AutomaticVisibility : Window.FullScreen;
}
QtObject {
id: settings
property real vw: presentationWindow.width / 100.0
property real vh: presentationWindow.height / 100.0
property real baseFontSize: 4 * vh
property string fontFamily: "Titillium web" //TODO
property real slideMargin: 5 * settings.vh
property string qmlscene: "/home/johan/dev/qt/build/dev/qtbase/bin/qmlscene"
property string srcDir: "/home/johan/dev/qtws17-compositor/"
}
visible: true
width: 1920
height: 1080
title: "Qt World Summit 2017 Compositor - " + rootCompositor.socketName
SwipeView {
id: deck
anchors.fill: parent
interactive: false // use keyboard to switch slides instead
Shortcut { sequence: "ctrl+left"; onActivated: deck.decrementCurrentIndex() }
Shortcut { sequence: "ctrl+right"; onActivated: deck.incrementCurrentIndex() }
//currentIndex: 6
TitleSlide { }
WaylandSlide { }
QtWaylandCompositorSlide {
workingDirectory: settings.srcDir + "demo-compositors/minimal/"
qmlfile: "compositor.qml"
}
NiceEditorSlide {
workingDirectory: settings.srcDir + "demo-compositors/shell-extensions/"
qmlfile: "compositor.qml"
title: "Shell extensions"
}
NiceEditorSlide {
workingDirectory: settings.srcDir + "demo-compositors/ivi-application/"
qmlfile: "compositor.qml"
title: "Not a desktop"
}
NiceEditorSlide {
workingDirectory: settings.srcDir + "demo-compositors/overview-compositor/"
qmlfile: "compositor.qml"
title: "Example: App overview"
}
NiceEditorSlide {
workingDirectory: settings.srcDir + "demo-compositors/tabbed-compositor/"
qmlfile: "compositor.qml"
title: "Example: Tabs"
}
FullScreenCompositorSlide {
id: physicsCompositorSlide
workingDirectory: settings.srcDir + "demo-compositors/physics-compositor/"
qmlfile: "main.qml"
compositorApplication: "./build/physics-compositor"
Timer {
interval: 1000
repeat: true
running: physicsCompositorSlide.SwipeView.isCurrentItem
onTriggered: {
var environment = {
WAYLAND_DISPLAY: "wayland-0",
QT_WAYLAND_DISABLE_WINDOWDECORATION: "0"
};
rootCompositor.runApplication("wiggly", environment);
}
}
BulletPoint {
anchors.horizontalCenter: parent.horizontalCenter
y: parent.height * 0.77
text: "#qt-lighthouse on freenode"
}
BulletPoint {
anchors.horizontalCenter: parent.horizontalCenter
y: parent.height * 0.82
text: "[email protected]"
}
BulletPoint {
anchors.horizontalCenter: parent.horizontalCenter
y: parent.height * 0.87
text: "github.com/johanhelsing/qtws17-compositor"
}
}
}
QtShape {
enabled: false
anchors.fill: parent
triangleWidth: settings.vh * 4
}
Runner { anchors.fill: parent }
Shortcut { sequence: "F1"; onActivated: terminalDrawer.open() }
TerminalDrawer {
id: terminalDrawer
height: parent.height
}
}
}
WlShell {
onWlShellSurfaceCreated: {
console.log("rootCompositor wlShellSurfaceCreated", shellSurface)
shellSurfaces.append({shellSurface: shellSurface})
}
}
IviApplication {
id: iviApplication
property int nextIviId: 1337
function getUniqueIviId() { return nextIviId++; }
}
}