aboutsummaryrefslogtreecommitdiffstats
path: root/qml/ImageButton.qml
diff options
context:
space:
mode:
authornils <nils@34ebc366-c3a9-4b3c-9f84-69acf7962910>2013-10-15 22:42:42 +0000
committernils <nils@34ebc366-c3a9-4b3c-9f84-69acf7962910>2013-10-15 22:42:42 +0000
commite3af44efea5b406684efb32db491c34138101d19 (patch)
tree588a013c6e519de0179c9480526863265f0af853 /qml/ImageButton.qml
parentbeautified keydetail widget (diff)
downloadgpg4usb-e3af44efea5b406684efb32db491c34138101d19.tar.gz
gpg4usb-e3af44efea5b406684efb32db491c34138101d19.zip
some cleanup
git-svn-id: http://cpunk.de/svn/src/gpg4usb/trunk@1064 34ebc366-c3a9-4b3c-9f84-69acf7962910
Diffstat (limited to 'qml/ImageButton.qml')
-rw-r--r--qml/ImageButton.qml71
1 files changed, 71 insertions, 0 deletions
diff --git a/qml/ImageButton.qml b/qml/ImageButton.qml
new file mode 100644
index 0000000..7aaba27
--- /dev/null
+++ b/qml/ImageButton.qml
@@ -0,0 +1,71 @@
+// import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
+import QtQuick 1.1
+
+ Rectangle {
+ id: container
+
+ property string text: "Button"
+ property string image: ""
+
+ signal clicked
+
+ width: buttonLabel.width + 5
+ height: buttonLabel.height + buttonImage.height + 5
+ //width: 60
+ //height: 60
+ //border { width: 1; color: Qt.darker(activePalette.button) }
+ //smooth: true
+ radius: 8
+ color: ffffff;
+
+ /*gradient: Gradient {
+ GradientStop {
+ position: 0.0
+ color: !mouseArea.pressed ? activePalette.light : activePalette.button
+ }
+ GradientStop {
+ position: 1.0
+ color: !mouseArea.pressed ? activePalette.button : activePalette.dark
+ }
+ }*/
+
+ SystemPalette { id: activePalette }
+// // color the button with a gradient
+// gradient: Gradient {
+// GradientStop {
+// position: 0.0
+// color: {
+// if (mouseArea.pressed)
+// return activePalette.dark
+// else
+// return activePalette.light
+// }
+// }
+// GradientStop { position: 1.0; color: activePalette.button }
+// }
+
+ MouseArea {
+ id: mouseArea
+ anchors.fill: parent
+ onClicked: container.clicked();
+ }
+
+ Image {
+ id: buttonImage
+ y: 5
+ source: container.image
+ height: 30
+ width: 30
+ anchors.horizontalCenter: parent.horizontalCenter
+ //anchors.fill: parent
+ }
+
+ Text {
+ id: buttonLabel
+ //anchors.centerIn: container
+ anchors { top: buttonImage.bottom; horizontalCenter: parent.horizontalCenter }
+ color: activePalette.buttonText
+ text: container.text
+ horizontalAlignment: Text.AlignLeft
+ }
+ }