OSDN Git Service

4ebd733b4d617e8b32082a2aa512517fd5d326c8
[fontmanager/fontmanager.git] / qml / fontmanager / BottomButtons.qml
1 import QtQuick 1.1
2 import com.nokia.meego 1.0
3 import 'UIConstants.js' as UI
4
5 Item {
6     id: bottomButtons
7     
8     property Item targetTab
9
10     height: bottomItem.height + importButton.height + UI.DEFAULT_MARGIN * 2
11
12     Rectangle {
13         anchors.fill: parent
14         anchors.topMargin: UI.DEFAULT_MARGIN / 2
15         gradient: Gradient {
16             GradientStop { position: 0.0; color: Qt.lighter("#76221d") }
17             GradientStop { position: 1.0; color: Qt.lighter("#bd543d") }
18         }
19     }
20     
21     Item {
22         id: bottomItem
23         anchors.bottom: importButton.top
24         anchors.left: parent.left
25         anchors.right: parent.right
26         height: UI.LIST_ITEM_HEIGHT_SMALL
27         
28         Button {
29             width: 75
30             anchors.left: parent.left
31             anchors.leftMargin: UI.DEFAULT_MARGIN
32             iconSource: "image://theme/icon-m-toolbar-down"
33             onClicked: targetTab.moveDownFamily()
34             enabled: targetTab !== null &&
35                      (targetTab.listView.currentIndex >= 0 &&
36                       targetTab.listView.currentIndex < targetTab.listView.count - 1) &&
37                      (!targetTab.listView.model.get(targetTab.listView.currentIndex+1).header)
38         }
39         
40         Button {
41             width: 75
42             anchors.horizontalCenter: parent.horizontalCenter
43             iconSource: "image://theme/icon-m-toolbar-delete"
44             onClicked: targetTab.removeFamily()
45             enabled: targetTab !== null && targetTab.listView.currentIndex >= 0
46         }
47         
48         Button {
49             width: 75
50             anchors.right: parent.right
51             anchors.rightMargin: UI.DEFAULT_MARGIN
52             iconSource: "image://theme/icon-m-toolbar-up"
53             onClicked: targetTab.moveUpFamily()
54             enabled: targetTab !== null && (targetTab.listView.currentIndex > 0) && (!targetTab.listView.model.get(targetTab.listView.currentIndex-1).header)
55         }
56     }
57     
58     Button {
59         id: importButton
60         anchors.horizontalCenter: parent.horizontalCenter
61         anchors.bottom: parent.bottom
62         anchors.bottomMargin: UI.DEFAULT_MARGIN
63         text: qsTr("Import System Settings")
64         opacity: 0.9
65         onClicked: {
66             controller.importSystemSettings(targetTab.family)
67         }
68         enabled: targetTab !== null
69     }
70 }