summaryrefslogtreecommitdiffstats
path: root/examples/applicationmanager/bubblewrap-example/system-ui.qml
blob: 89668de94fa20622d5cf5c5cb32a17ad3cb5128a (plain)
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
// Copyright (C) 2023 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause

import QtQuick 2.4
import QtApplicationManager.SystemUI 2.0

Item {
    width: 800
    height: 600

    // Show application names and icons
    Column {

        Repeater {
            model: ApplicationManager
            Item {
                width: 200
                height: 200

                Image {
                    id: icon
                    source: model.icon
                    anchors.centerIn: parent
                    MouseArea {
                        anchors.fill: parent
                        onClicked: model.isRunning ? application.stop() : application.start()
                    }
                }
                Text {
                    font.pixelSize: 15
                    text: model.name
                    anchors.top: icon.bottom
                    anchors.topMargin: 5
                    anchors.horizontalCenter: icon.horizontalCenter
                }
            }
        }
    }

    // Show windows
    Column {
        anchors.right: parent.right
        spacing: 1

        Repeater {
            model: WindowManager
            WindowItem {
                width: 600
                height: 200
                window: model.window
            }
        }
    }
}