WWW update
[ubi] / qml / ubi / components / DialogInput.qml
1 import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
2 import "../UIConstants.js" as Const
3
4 DialogBox {
5     id: root
6
7     property alias label: text.text
8     property alias placeholderText: input.placeholderText
9     property string text
10     property alias textWidth: input.width
11
12     signal closed(string resp)
13
14     function reset() {
15         input.text = "";
16     }
17
18     onClosed: input.closeSoftwareInputPanel()
19     onCanceled: input.closeSoftwareInputPanel()
20
21     Rectangle {
22         id: box
23         anchors.left: root.left; anchors.right: root.right
24         height: column.height
25         anchors.bottom: root.bottom
26         color: Const.LIGHT_AUBERGINE_COLOR
27
28         MouseArea {
29             anchors.fill: parent
30         }
31
32         Column {
33             id: column
34             spacing: Const.DEFAULT_MARGIN
35             anchors.horizontalCenter: parent.horizontalCenter
36             Spacer {}
37
38             Text {
39                 id: text
40                 color: Const.DEFAULT_DIALOG_FOREGROUND_COLOR
41                 font.pixelSize: Const.DEFAULT_FONT_PIXEL_SIZE
42             }
43
44             TextField {
45                 id: input
46             }
47
48             Row {
49                 spacing: Const.DEFAULT_MARGIN
50                 Button {
51                     label: "Ok"
52                     onButtonClicked: {
53                         root.close();
54                         root.closed(input.text);
55                     }
56                 }
57             }
58             Spacer {}
59         }
60     }
61
62     Rectangle {
63         anchors.right: root.right; anchors.left: root.left
64         anchors.bottom: box.top
65         height: Const.SHADOW_OFFSET
66         color: "black"
67         opacity: 0.5
68     }
69 }