Compare commits

...

1 Commits

Author SHA1 Message Date
vladimir.kuznetsov bbcf928a66 added tab navigation to the share connection drawer 2024-02-19 19:17:24 +05:00
2 changed files with 28 additions and 20 deletions
@@ -38,6 +38,14 @@ DrawerType2 {
expandedContent: Item { expandedContent: Item {
implicitHeight: root.expandedHeight implicitHeight: root.expandedHeight
Connections {
target: root
function onOpened() {
header.forceActiveFocus()
}
}
Header2Type { Header2Type {
id: header id: header
anchors.top: parent.top anchors.top: parent.top
@@ -48,6 +56,8 @@ DrawerType2 {
anchors.rightMargin: 16 anchors.rightMargin: 16
headerText: root.headerText headerText: root.headerText
KeyNavigation.tab: shareButton
} }
FlickableType { FlickableType {
@@ -68,12 +78,15 @@ DrawerType2 {
visible: root.contentVisible visible: root.contentVisible
BasicButtonType { BasicButtonType {
id: shareButton
Layout.fillWidth: true Layout.fillWidth: true
Layout.topMargin: 16 Layout.topMargin: 16
text: qsTr("Share") text: qsTr("Share")
imageSource: "qrc:/images/controls/share-2.svg" imageSource: "qrc:/images/controls/share-2.svg"
KeyNavigation.tab: copyConfigTextButton
clickedFunc: function() { clickedFunc: function() {
var fileName = "" var fileName = ""
if (GC.isMobile()) { if (GC.isMobile()) {
@@ -108,12 +121,7 @@ DrawerType2 {
text: qsTr("Copy") text: qsTr("Copy")
imageSource: "qrc:/images/controls/copy.svg" imageSource: "qrc:/images/controls/copy.svg"
clickedFunc: function() { KeyNavigation.tab: copyNativeConfigStringButton.visible ? copyNativeConfigStringButton : showSettingsButton
configText.selectAll()
configText.copy()
configText.select(0, 0)
PageController.showNotificationMessage(qsTr("Copied"))
}
} }
BasicButtonType { BasicButtonType {
@@ -133,15 +141,12 @@ DrawerType2 {
text: qsTr("Copy config string") text: qsTr("Copy config string")
imageSource: "qrc:/images/controls/copy.svg" imageSource: "qrc:/images/controls/copy.svg"
clickedFunc: function() { KeyNavigation.tab: showSettingsButton
nativeConfigString.selectAll()
nativeConfigString.copy()
nativeConfigString.select(0, 0)
PageController.showNotificationMessage(qsTr("Copied"))
}
} }
BasicButtonType { BasicButtonType {
id: showSettingsButton
Layout.fillWidth: true Layout.fillWidth: true
Layout.topMargin: 24 Layout.topMargin: 24
@@ -157,6 +162,8 @@ DrawerType2 {
clickedFunc: function() { clickedFunc: function() {
configContentDrawer.open() configContentDrawer.open()
} }
KeyNavigation.tab: header
} }
DrawerType2 { DrawerType2 {
+9 -8
View File
@@ -31,22 +31,23 @@ Button {
hoverEnabled: true hoverEnabled: true
background: Rectangle { background: Rectangle {
id: background_border id: focusBorder
color: "transparent" color: "transparent"
border.color: root.activeFocus ? root.borderFocusedColor : "transparent" border.color: root.activeFocus ? root.borderFocusedColor : "transparent"
border.width: root.activeFocus ? root.borderFocusedWidth : "transparent" border.width: root.activeFocus ? root.borderFocusedWidth : "transparent"
anchors.fill: parent anchors.fill: parent
radius: 16 radius: 16
Rectangle { Rectangle {
id: background id: background
anchors.fill: background_border anchors.fill: focusBorder
anchors.margins: root.activeFocus ? 2: 0 anchors.margins: root.activeFocus ? 2 : 0
radius: 16 radius: root.activeFocus ? 14 : 16
color: { color: {
if (root.enabled) { if (root.enabled) {
if (root.pressed) { if (root.pressed) {
@@ -57,8 +58,8 @@ Button {
return disabledColor return disabledColor
} }
} }
border.color: root.activeFocus ? "transparent" : borderColor border.color: borderColor
border.width: root.activeFocus ? 0 : borderWidth border.width: borderWidth
Behavior on color { Behavior on color {
PropertyAnimation { duration: 200 } PropertyAnimation { duration: 200 }
@@ -93,13 +94,13 @@ Button {
} }
MouseArea { MouseArea {
anchors.fill: background_border anchors.fill: focusBorder
enabled: false enabled: false
cursorShape: Qt.PointingHandCursor cursorShape: Qt.PointingHandCursor
} }
contentItem: Item { contentItem: Item {
anchors.fill: background_border anchors.fill: focusBorder
implicitWidth: content.implicitWidth implicitWidth: content.implicitWidth
implicitHeight: content.implicitHeight implicitHeight: content.implicitHeight