--- /dev/null
+import QtQuick 1.0\r
+\r
+Item {\r
+ id: container\r
+\r
+ property string buttonName: "NOT SET"\r
+ property string target: "NOT SET"\r
+ property string text: "NOT SET"\r
+\r
+ property string fontName: "Helvetica"\r
+ property int fontSize: 14\r
+ property color fontColor: "black"\r
+\r
+ property bool active: false\r
+\r
+ property string bgImage: theme_manager.theme.datepicker.button\r
+ property string bgImagePressed: theme_manager.theme.datepicker.button_pressed\r
+ property string bgImageActive: theme_manager.theme.datepicker.button_active\r
+\r
+ // These Component properties can be used to modify the Button's LaF\r
+ // from the calling component. They have to define a BorderImage component.\r
+ property Component bg: defaultBackground\r
+ property Component bgPressed: defaultPressedBackground\r
+ property Component bgActive: defaultActiveBackground\r
+\r
+ signal clicked(string target, string button)\r
+\r
+ width: 140\r
+ height: 60\r
+ opacity: enabled ? 1.0 : 0.5 \r
+\r
+ Loader {\r
+ id: background\r
+ sourceComponent: container.bg\r
+ anchors.fill: parent\r
+ }\r
+\r
+ Component {\r
+ id: defaultBackground\r
+ BorderImage {\r
+ border { top: 8; bottom: 8; left: 8; right: 8 }\r
+ source: bgImage\r
+ }\r
+ }\r
+ Component {\r
+ id: defaultPressedBackground\r
+ BorderImage {\r
+ border { top: 8; bottom: 8; left: 8; right: 8 }\r
+ source: bgImagePressed\r
+ }\r
+ }\r
+\r
+ Component {\r
+ id: defaultActiveBackground\r
+ BorderImage {\r
+ border { top: 8; bottom: 8; left: 8; right: 8 }\r
+ source: bgImageActive\r
+ }\r
+ }\r
+\r
+ Text {\r
+ id: buttonLabel\r
+ text: parent.text\r
+ wrapMode: Text.WordWrap\r
+\r
+ anchors {\r
+ horizontalCenter: parent.horizontalCenter\r
+ verticalCenter: parent.verticalCenter\r
+ }\r
+ font {\r
+ family: container.fontName\r
+ pointSize: container.fontSize\r
+ }\r
+ color: container.fontColor\r
+ }\r
+\r
+ MouseArea {\r
+ id: mouseArea\r
+ anchors.fill: parent\r
+\r
+ }\r
+\r
+ states: [\r
+ State {\r
+ name: 'pressed'; when: mouseArea.pressed\r
+ PropertyChanges { target: background; sourceComponent: container.bgPressed }\r
+ },\r
+ State {\r
+ name: 'active'; when: container.active\r
+ PropertyChanges { target: background; sourceComponent: container.defaultActiveBackground; }\r
+ }\r
+ ]\r
+\r
+}\r