Harmattan font changes completed
[marketstoday] / src / qml / Config.qml
1 /*
2 @version: 0.5
3 @author: Sudheer K. <scifi1947 at gmail.com>
4 @license: GNU General Public License
5 */
6
7 import Qt 4.7
8 import "Library" as Library
9
10 Rectangle {
11     id: screen
12
13     width: 800; height: 480
14
15     property int componentWidth: screen.width
16     property int itemHeight: 50
17
18     function close(){
19         Qt.quit();
20     }
21
22     function back(){
23         configArea.sourceComponent = configParentComponent;
24         titleBar.buttonType = "Close";
25     }    
26
27     Library.TitleBar {
28         id: titleBar; width: parent.width; height: 60;
29         anchors.top: parent.top
30         title: "Markets Today - Configuration"
31         buttonType: "Close"
32         onCloseClicked: close()
33         onBackClicked: back()
34     }
35
36     Loader {
37         id: configArea
38         sourceComponent: configParentComponent
39         anchors.top: titleBar.bottom
40         anchors.bottom: parent.bottom
41         width: parent.width
42     }
43
44     Component {
45         id: configParentComponent
46         ConfigOptionsComponent {
47             id: configOptionsComponent
48             onTickersOptionSelected: {
49                 configArea.sourceComponent = tickersComponent;
50                 titleBar.buttonType = "Back";
51             }
52             onSettingsOptionSelected: {
53                 configArea.sourceComponent = settingsComponent;
54                 titleBar.buttonType = "Back";
55             }
56         }
57     }
58
59     Component {
60         id: tickersComponent
61         ConfigTickersComponent {
62             id: tickersTab
63             anchors.fill: parent
64             componentWidth: screen.componentWidth
65             itemHeight: screen.itemHeight
66             onLogRequest: logUtility.logMessage(strMessage)
67
68         }
69     }
70
71     Component {
72         id: settingsComponent
73         ConfigParametersComponent {
74             id: settingsTab
75             anchors.fill: parent
76             onLogRequest: logUtility.logMessage(strMessage)
77         }
78     }
79 }