aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAntti Hölttä <AHoelttae@luxoft.com>2018-11-23 15:06:30 +0100
committerAntti Hölttä <AHoelttae@luxoft.com>2019-03-18 16:33:53 +0100
commit67dd94b0daecc445bbd3af7b5956ddcbdbdb5f39 (patch)
treeba4c6a02ed596a57d3e86f4e738f461ec37f94bb
parentd87734d37a0c9689647b4eaaef1eeda318c3f8be (diff)
Add cursor navigable TabButton
-rw-r--r--DemoApplication/controls/CNTabButton.qml14
-rw-r--r--DemoApplication/main.qml10
2 files changed, 18 insertions, 6 deletions
diff --git a/DemoApplication/controls/CNTabButton.qml b/DemoApplication/controls/CNTabButton.qml
new file mode 100644
index 0000000..7557832
--- /dev/null
+++ b/DemoApplication/controls/CNTabButton.qml
@@ -0,0 +1,14 @@
+import QtQuick 2.9
+import QtQuick.Controls 2.2
+import CursorNavigation 1.0
+
+TabButton {
+ CursorNavigation.acceptsCursor: true
+ Rectangle {
+ anchors.fill: parent
+ color: "transparent"
+ border.width: 2
+ border.color: "red"
+ visible: parent.CursorNavigation.hasCursor
+ }
+}
diff --git a/DemoApplication/main.qml b/DemoApplication/main.qml
index b0e54cb..6ea81f1 100644
--- a/DemoApplication/main.qml
+++ b/DemoApplication/main.qml
@@ -4,6 +4,7 @@ import QtQuick.Layouts 1.3
import CursorNavigation 1.0
import "pages"
+import "controls"
ApplicationWindow {
id: window
@@ -15,16 +16,13 @@ ApplicationWindow {
header: TabBar {
id: tabBar
width: parent.width
- TabButton {
- CursorNavigation.acceptsCursor: true
+ CNTabButton {
text: qsTr("Page 1")
}
- TabButton {
- CursorNavigation.acceptsCursor: true
+ CNTabButton {
text: qsTr("Page 2")
}
- TabButton {
- CursorNavigation.acceptsCursor: true
+ CNTabButton {
text: qsTr("Page 3")
}
}