aboutsummaryrefslogtreecommitdiffstats
path: root/launcher/qml/UninstallDialog.qml
blob: 422952591e1ca2982e573e0fe8a99c9b64a10514 (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
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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
import QtQuick 2.0
import QtQuick.Layouts 1.1
import QtQuick.Controls 2.0

Item {
    id: root
    width: 1080
    height: 1920
    property string contents: ''
    property string uninstallApp: ''
    property int pid: -1

    MouseArea {
        anchors.fill: parent
        onPressAndHold: {}
        onPressed: {}
        onReleased: {}
        onClicked: {}
    }

    Rectangle {
        id: mainform
        height: 300
        width: 1000
        radius:2
        anchors.centerIn: parent

        gradient: Gradient {
            GradientStop { position: 0.0; color: "#12262E" }
            GradientStop { position: 1.0; color: "#18899B" }
        }

        ColumnLayout {
            anchors {
              topMargin: 10; bottomMargin:10
              leftMargin: 20; rightMargin: 20
              fill: parent
            }
            spacing: 2

            ColumnLayout {
                id: title_part
                anchors {
                    top: parent.top
                    left: parent.left
                        topMargin: 10
                }

                Label {
                    id: title
                    text: 'Uninstall Dialog'
                    color: "white"
                    font.pixelSize: 32
                    font.bold: true
                    maximumLineCount: 1
                    wrapMode: Text.Wrap
                    elide: Text.ElideRight
                    horizontalAlignment: Label.AlignHCenter
                    verticalAlignment: Label.AlignVCenter
                    Layout.preferredWidth:  960
                    Layout.preferredHeight:  40
                }

                Image {
                    source: './images/DividingLine.svg'
                    anchors.left: title.left
                    anchors.top: title.bottom
                }
            }

            RowLayout {
                id: contents_part
                anchors {
                  left: parent.left; leftMargin: 20
                  right: parent.right; rightMargin: 20
                }
                Layout.preferredWidth: 920
                Layout.alignment: Qt.AlignVCenter | Qt.AlignHCenter
                spacing: 10
                Image {
                    id: dsp_mark
                    source: './images/uninstall.png'
                    Layout.maximumHeight: 120
                    Layout.maximumWidth:  120
                }
                Label {
                    text: root.contents
                    color: "white"
                    font.pixelSize: 24
                    wrapMode: Text.Wrap
                    elide: Text.ElideRight
                    horizontalAlignment: Label.AlignLeft
                    verticalAlignment: Label.AlignVCenter
                    Layout.preferredWidth: 780
                    Layout.preferredHeight: 160
                }
            }

            RowLayout {
                id: btn_area
                spacing: 60
                anchors {
                  horizontalCenter: parent.horizontalCenter
                }
                Layout.preferredWidth: parent.width*0.75
                Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter

                Button {
                    id: btn1
                    text: 'YES'
                    onReleased: {
                        btn1.highlighted = false
                        root.visible = false
                        pid = homescreenHandler.uninstallApplication(uninstallApp)
                        if(pid < 1) {
                            console.warn("app cannot be uninstaled!")
                        }
                    }
                    onPressed: {
                        btn1.highlighted = true
                    }
                    onCanceled: {
                        btn1.highlighted = false
                    }
                    Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
                }

                Button {
                    id: btn2
                    text: 'NO'
                    onReleased: {
                        btn2.highlighted = false
                        root.visible = false
                    }
                    onPressed: {
                        btn2.highlighted = true
                    }
                    onCanceled: {
                        btn2.highlighted = false
                    }
                    Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
                }
            }

            Rectangle {
                id: footer
                opacity: 0
                width: parent.width
                height: 5
                anchors {
                    bottom: parent.bottom
                }
            }
        }

    }

}