58fd4c23b02098d2ded31a82073e4d5088edaa9a
[ubi] / qml / ubi / components / DialogInfo.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 text: text.text
8     property alias elide: text.elide
9     property alias iconSource: icon.source
10     property int fontSize: Const.DEFAULT_FONT_PIXEL_SIZE
11
12     Rectangle {
13         id: box
14         anchors.left: root.left; anchors.right: root.right
15         height: column.height
16         anchors.bottom: root.bottom
17         color: Const.LIGHT_AUBERGINE_COLOR
18
19         MouseArea {
20             anchors.fill: parent
21             onClicked: {
22                 root.canceled();
23                 root.close();
24             }
25         }
26
27         Column {
28             id: column
29             spacing: Const.DEFAULT_MARGIN
30             x: Const.DEFAULT_MARGIN
31
32             Spacer {}
33
34             Row {
35                 spacing: Const.DEFAULT_MARGIN
36                 Image {
37                     id: icon
38                     width: 50
39                     height: 50
40                     visible: source!=""
41                 }
42
43                 Text {
44                     id: text
45                     color: Const.DEFAULT_DIALOG_FOREGROUND_COLOR
46                     font.pixelSize: root.fontSize
47                     wrapMode: Text.Wrap
48                     width: root.width - 6*Const.DEFAULT_MARGIN
49                 }
50             }
51
52             Spacer {}
53         }
54     }
55
56     Rectangle {
57         anchors.right: root.right; anchors.left: root.left
58         anchors.bottom: box.top
59         height: Const.SHADOW_OFFSET
60         color: "black"
61         opacity: 0.5
62     }
63 }