registerShortcut
[apps/launcher.git] / launcher / qml / UninstallDialog.qml
1 import QtQuick 2.0
2 import QtQuick.Layouts 1.1
3 import QtQuick.Controls 2.0
4
5 Item {
6     id: root
7     width: 1080
8     height: 1920
9     property string contents: ''
10     property string uninstallApp: ''
11     property int pid: -1
12
13     MouseArea {
14         anchors.fill: parent
15         onPressAndHold: {}
16         onPressed: {}
17         onReleased: {}
18         onClicked: {}
19     }
20
21     Rectangle {
22         id: mainform
23         height: 300
24         width: 1000
25         radius:2
26         anchors.centerIn: parent
27
28         gradient: Gradient {
29             GradientStop { position: 0.0; color: "#12262E" }
30             GradientStop { position: 1.0; color: "#18899B" }
31         }
32
33         ColumnLayout {
34             anchors {
35               topMargin: 10; bottomMargin:10
36               leftMargin: 20; rightMargin: 20
37               fill: parent
38             }
39             spacing: 2
40
41             ColumnLayout {
42                 id: title_part
43                 anchors {
44                     top: parent.top
45                     left: parent.left
46                         topMargin: 10
47                 }
48
49                 Label {
50                     id: title
51                     text: 'Uninstall Dialog'
52                     color: "white"
53                     font.pixelSize: 32
54                     font.bold: true
55                     maximumLineCount: 1
56                     wrapMode: Text.Wrap
57                     elide: Text.ElideRight
58                     horizontalAlignment: Label.AlignHCenter
59                     verticalAlignment: Label.AlignVCenter
60                     Layout.preferredWidth:  960
61                     Layout.preferredHeight:  40
62                 }
63
64                 Image {
65                     source: './images/DividingLine.svg'
66                     anchors.left: title.left
67                     anchors.top: title.bottom
68                 }
69             }
70
71             RowLayout {
72                 id: contents_part
73                 anchors {
74                   left: parent.left; leftMargin: 20
75                   right: parent.right; rightMargin: 20
76                 }
77                 Layout.preferredWidth: 920
78                 Layout.alignment: Qt.AlignVCenter | Qt.AlignHCenter
79                 spacing: 10
80                 Image {
81                     id: dsp_mark
82                     source: './images/uninstall.png'
83                     Layout.maximumHeight: 120
84                     Layout.maximumWidth:  120
85                 }
86                 Label {
87                     text: root.contents
88                     color: "white"
89                     font.pixelSize: 24
90                     wrapMode: Text.Wrap
91                     elide: Text.ElideRight
92                     horizontalAlignment: Label.AlignLeft
93                     verticalAlignment: Label.AlignVCenter
94                     Layout.preferredWidth: 780
95                     Layout.preferredHeight: 160
96                 }
97             }
98
99             RowLayout {
100                 id: btn_area
101                 spacing: 60
102                 anchors {
103                   horizontalCenter: parent.horizontalCenter
104                 }
105                 Layout.preferredWidth: parent.width*0.75
106                 Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
107
108                 Button {
109                     id: btn1
110                     text: 'YES'
111                     onReleased: {
112                         btn1.highlighted = false
113                         root.visible = false
114                         pid = homescreenHandler.uninstallApplication(uninstallApp)
115                         if(pid < 1) {
116                             console.warn("app cannot be uninstaled!")
117                         }
118                     }
119                     onPressed: {
120                         btn1.highlighted = true
121                     }
122                     onCanceled: {
123                         btn1.highlighted = false
124                     }
125                     Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
126                 }
127
128                 Button {
129                     id: btn2
130                     text: 'NO'
131                     onReleased: {
132                         btn2.highlighted = false
133                         root.visible = false
134                     }
135                     onPressed: {
136                         btn2.highlighted = true
137                     }
138                     onCanceled: {
139                         btn2.highlighted = false
140                     }
141                     Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
142                 }
143             }
144
145             Rectangle {
146                 id: footer
147                 opacity: 0
148                 width: parent.width
149                 height: 5
150                 anchors {
151                     bottom: parent.bottom
152                 }
153             }
154         }
155
156     }
157
158 }