aboutsummaryrefslogtreecommitdiffstats
path: root/DemoApplication/controls
diff options
context:
space:
mode:
authorAlexandra Betouni <ABetouni@luxoft.com>2018-11-20 12:49:37 +0100
committerAntti Hölttä <AHoelttae@luxoft.com>2019-03-18 16:32:22 +0100
commitd87734d37a0c9689647b4eaaef1eeda318c3f8be (patch)
tree59e61cc9e9ddbf888bd0ab5964185cace219eb6a /DemoApplication/controls
parent4e53c46500bdbe9f6fd7228f14b27fb7262b0350 (diff)
Demo application clean up
Minor improvements in pro file for demo app Also update .gitignore to ignore DS_Store files Removed unecessary code and files
Diffstat (limited to 'DemoApplication/controls')
-rw-r--r--DemoApplication/controls/CNButton.qml38
1 files changed, 38 insertions, 0 deletions
diff --git a/DemoApplication/controls/CNButton.qml b/DemoApplication/controls/CNButton.qml
new file mode 100644
index 0000000..33299d1
--- /dev/null
+++ b/DemoApplication/controls/CNButton.qml
@@ -0,0 +1,38 @@
+import QtQuick 2.0
+import QtQuick.Controls 2.2
+import CursorNavigation 1.0
+
+Button {
+ id: root
+ implicitWidth: (textLabel.contentWidth + 40)
+ implicitHeight: 40
+
+ CursorNavigation.acceptsCursor: true
+ property bool hasCursor: CursorNavigation.hasCursor
+
+ background: Rectangle {
+ anchors.fill: parent
+ radius: 40
+ opacity: root.pressed ? 0.6 : 0.4
+ color: "grey"
+ }
+
+ contentItem: Item {
+ anchors.fill: parent
+ Label {
+ id: textLabel
+ anchors.centerIn: parent
+ font.pixelSize: 14
+ color: "blue"
+ text: root.text
+ }
+
+ Rectangle {
+ border.width: 2
+ border.color: "red"
+ anchors.fill: parent
+ visible: root.hasCursor
+ color: "transparent"
+ }
+ }
+}