OSDN Git Service

Version: 0.4.3
[fontmanager/fontmanager.git] / qml / fontmanager / HelpDialog.qml
1 // import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
2 import QtQuick 1.1
3 import com.nokia.meego 1.1
4 import 'UIConstants.js' as UI
5
6 Item {
7     id: helpDialog
8     property string titleText: qsTr("Help")
9     property string message
10
11     signal clicked
12
13     Rectangle {
14         id: textRect
15         anchors.fill: parent
16         anchors.margins: UI.DEFAULT_MARGIN
17         color: "white"
18
19         Text {
20             id: helpTitle
21             anchors.top: parent.top
22             anchors.left: parent.left
23             anchors.right: parent.right
24             anchors.bottomMargin: UI.DEFAULT_MARGIN
25             text: helpDialog.titleText
26             font.pixelSize: UI.FONT_XLARGE
27             font.bold: true
28             horizontalAlignment: Text.AlignHCenter
29         }
30
31         Rectangle {
32             id: border
33             anchors.top: helpTitle.bottom
34             anchors.bottom: okButton.top
35             anchors.left: parent.left
36             anchors.right: parent.right
37             anchors.rightMargin: 1
38             anchors.bottomMargin: UI.DEFAULT_MARGIN
39             clip: true
40
41             border.width: 1
42             border.color: "lightgray"
43             color: "transparent"
44
45             Flickable {
46                 id: textFlickable
47                 anchors.fill: parent
48                 anchors.margins: UI.DEFAULT_MARGIN
49                 boundsBehavior: Flickable.StopAtBounds
50                 //            contentWidth: helpText.paintedWidth
51                 contentHeight: helpText.paintedHeight
52                 Text {
53                     id: helpText
54                     text: helpDialog.message
55                     font.pixelSize: UI.FONT_DEFAULT
56                     color: "black"
57                     wrapMode: Text.WrapAtWordBoundaryOrAnywhere
58                     width: parent.width
59                     onLinkActivated: Qt.openUrlExternally(link)
60                 }
61             }
62
63             ScrollDecorator {
64                 flickableItem: textFlickable
65             }
66
67         }
68
69         Button {
70             id: okButton
71             text: qsTr("OK")
72             anchors.horizontalCenter: parent.horizontalCenter
73             anchors.bottom: parent.bottom
74             anchors.margins: UI.DEFAULT_MARGIN
75             onClicked: helpDialog.clicked()
76         }
77
78     }
79
80     Rectangle {
81         id: shadowRight
82         color: "darkgray"
83         anchors.left: textRect.right
84         anchors.bottom: textRect.bottom
85         width: UI.DEFAULT_MARGIN / 2
86         height: textRect.height - UI.DEFAULT_MARGIN / 2
87     }
88     Rectangle {
89         id: shadowBottom
90         color: "darkgray"
91         anchors.left: textRect.left
92         anchors.leftMargin: UI.DEFAULT_MARGIN / 2
93         anchors.top: textRect.bottom
94         width:textRect.width
95         height: UI.DEFAULT_MARGIN / 2
96     }
97 }