Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
CyAn84 committed Dec 25, 2024
1 parent f8f4d75 commit f41c23f
Show file tree
Hide file tree
Showing 22 changed files with 610 additions and 659 deletions.
26 changes: 1 addition & 25 deletions client/ui/qml/Components/HomeContainersListView.qml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ ListView {
property var selectedText

width: rootWidth
height: contentItem.height // TODO: It should be fixed size, not content item height
height: contentItem.height

clip: true
// interactive: false
Expand All @@ -34,30 +34,6 @@ ListView {

property bool isFocusable: true

Keys.onTabPressed: {
FocusController.nextKeyTabItem()
}

Keys.onBacktabPressed: {
FocusController.previousKeyTabItem()
}

Keys.onUpPressed: {
FocusController.nextKeyUpItem()
}

Keys.onDownPressed: {
FocusController.nextKeyDownItem()
}

Keys.onLeftPressed: {
FocusController.nextKeyLeftItem()
}

Keys.onRightPressed: {
FocusController.nextKeyRightItem()
}

// activeFocusOnTab: true
// onActiveFocusChanged: {
// console.log("===========================")
Expand Down
8 changes: 1 addition & 7 deletions client/ui/qml/Components/SettingsContainersListView.qml
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,10 @@ ListView {
height: root.contentItem.height

clip: true
interactive: false
reuseItems: true

property bool isFocusable: false

onVisibleChanged: {
if (visible) {
this.currentIndex = 0
}
}

delegate: Item {
implicitWidth: root.width
implicitHeight: delegateContent.implicitHeight
Expand Down
24 changes: 0 additions & 24 deletions client/ui/qml/Components/ShareConnectionDrawer.qml
Original file line number Diff line number Diff line change
Expand Up @@ -61,30 +61,6 @@ DrawerType2 {

property bool isFocusable: true

Keys.onTabPressed: {
FocusController.nextKeyTabItem()
}

Keys.onBacktabPressed: {
FocusController.previousKeyTabItem()
}

Keys.onUpPressed: {
FocusController.nextKeyUpItem()
}

Keys.onDownPressed: {
FocusController.nextKeyDownItem()
}

Keys.onLeftPressed: {
FocusController.nextKeyLeftItem()
}

Keys.onRightPressed: {
FocusController.nextKeyRightItem()
}

ScrollBar.vertical: ScrollBarType {}

model: 1
Expand Down
1 change: 1 addition & 0 deletions client/ui/qml/Controls2/BackButtonType.qml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ FocusScope {

property string backButtonImage: "qrc:/images/controls/arrow-left.svg"
property var backButtonFunction
property alias backBtn: backButton

implicitWidth: content.implicitWidth
implicitHeight: content.implicitHeight
Expand Down
1 change: 0 additions & 1 deletion client/ui/qml/Controls2/BasicButtonType.qml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ Button {
implicitHeight: 56

hoverEnabled: true
focusPolicy: Qt.TabFocus

onFocusChanged: {
if (root.activeFocus) {
Expand Down
6 changes: 3 additions & 3 deletions client/ui/qml/Controls2/ListViewWithLabelsType.qml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ ListView {

property bool dividerVisible: false

currentIndex: 0
property int selectedIndex: 0

width: rootWidth
height: menuContent.contentItem.height
Expand Down Expand Up @@ -45,7 +45,7 @@ ListView {
rightImageSource: imageSource

clickedFunction: function() {
menuContent.currentIndex = index
menuContent.selectedIndex = index
menuContent.selectedText = name
if (menuContent.clickedFunction && typeof menuContent.clickedFunction === "function") {
menuContent.clickedFunction()
Expand All @@ -62,7 +62,7 @@ ListView {
}

Component.onCompleted: {
if (menuContent.currentIndex === index) {
if (menuContent.selectedIndex === index) {
menuContent.selectedText = name
}
}
Expand Down
1 change: 1 addition & 0 deletions client/ui/qml/Controls2/ListViewWithRadioButtonType.qml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ ListView {
height: root.contentItem.height

clip: true
reuseItems: true

property bool isFocusable: true

Expand Down
19 changes: 16 additions & 3 deletions client/ui/qml/Controls2/TextFieldWithHeaderType.qml
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,9 @@ Item {
errorText = qsTr("The field can't be empty")
}
}

focusReason: Qt.PopupFocusReason
activeFocusOnPress: true

MouseArea {
anchors.fill: parent
Expand Down Expand Up @@ -216,7 +219,12 @@ Item {

Keys.onEnterPressed: {
if (root.rightButtonClickedOnEnter && root.clickedFunc && typeof root.clickedFunc === "function") {
clickedFunc()
console.debug(">>> TextFieldWithHeaderType onEnterPressed triggered!!!")
if(SettingsController.isOnTv()) {
console.debug(">>> *** TVTVTVTVTVTVTVTVTVTVTV ***")
SystemController.sendTouch(this.x, this.y)
}
root.clickedFunc()
}

// if (KeyNavigation.tab) {
Expand All @@ -225,8 +233,13 @@ Item {
}

Keys.onReturnPressed: {
if (root.rightButtonClickedOnEnter &&root.clickedFunc && typeof root.clickedFunc === "function") {
clickedFunc()
if (root.rightButtonClickedOnEnter && root.clickedFunc && typeof root.clickedFunc === "function") {
console.debug(">>> TextFieldWithHeaderType onReturnPressed triggered!!!")
if(SettingsController.isOnTv()) {
console.debug(">>> *** TVTVTVTVTVTVTVTVTVTVTV ***")
SystemController.sendTouch(this.x, this.y)
}
root.clickedFunc()
}

// if (KeyNavigation.tab) {
Expand Down
8 changes: 8 additions & 0 deletions client/ui/qml/Controls2/TopCloseButtonType.qml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,14 @@ Popup {
color: AmneziaStyle.color.transparent
}

onOpened: { // TODO: check
FocusController.pushRootObject(root)
}

onClosed: {
FocusController.dropRootObject(root)
}

ImageButtonType {
id: button

Expand Down
46 changes: 28 additions & 18 deletions client/ui/qml/Pages2/PageDevMenu.qml
Original file line number Diff line number Diff line change
Expand Up @@ -16,42 +16,49 @@ import "../Components"
PageType {
id: root

ColumnLayout {
id: backButtonLayout
BackButtonType {
id: backButton

anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right

anchors.topMargin: 20

BackButtonType {
id: backButton
}
}

FlickableType {
id: fl
anchors.top: backButtonLayout.bottom
ListView {
id: listView
anchors.top: backButton.bottom
anchors.bottom: parent.bottom
contentHeight: content.implicitHeight
anchors.right: parent.right
anchors.left: parent.left

property bool isFocusable: true

ColumnLayout {
id: content
ScrollBar.vertical: ScrollBarType {}

anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
header: ColumnLayout {
width: listView.width

HeaderType {
id: header

Layout.fillWidth: true
Layout.topMargin: 16
Layout.rightMargin: 16
Layout.leftMargin: 16

headerText: "Dev menu"
}
}

model: 1

clip: true

spacing: 16

delegate: ColumnLayout {
width: listView.width

TextFieldWithHeaderType {
id: passwordTextField
Expand All @@ -60,7 +67,6 @@ PageType {
Layout.topMargin: 16
Layout.rightMargin: 16
Layout.leftMargin: 16
parentFlickable: fl

headerText: qsTr("Gateway endpoint")
textFieldText: SettingsController.gatewayEndpoint
Expand All @@ -78,14 +84,18 @@ PageType {
}
}
}
}

footer: ColumnLayout {
width: listView.width

SwitcherType {
id: switcher

Layout.fillWidth: true
Layout.topMargin: 24 // 16
Layout.rightMargin: 16
Layout.leftMargin: 16
Layout.topMargin: 16

text: qsTr("Dev gateway environment")
checked: SettingsController.isDevGatewayEnv
Expand Down
2 changes: 2 additions & 0 deletions client/ui/qml/Pages2/PageHome.qml
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,8 @@ PageType {
id: containersDropDown
objectName: "containersDropDown"

drawerHeight: 0.9

rootButtonImageColor: AmneziaStyle.color.midnightBlack
rootButtonBackgroundColor: AmneziaStyle.color.paleGray
rootButtonBackgroundHoveredColor: AmneziaStyle.color.mistyGray
Expand Down
35 changes: 3 additions & 32 deletions client/ui/qml/Pages2/PageProtocolAwgClientSettings.qml
Original file line number Diff line number Diff line change
Expand Up @@ -16,24 +16,19 @@ import "../Components"
PageType {
id: root

ColumnLayout {
id: backButtonLayout
BackButtonType {
id: backButton

anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right

anchors.topMargin: 20

BackButtonType {
id: backButton
}
}

ListView {
id: listview

anchors.top: backButtonLayout.bottom
anchors.top: backButton.bottom
anchors.bottom: saveButton.top

width: parent.width
Expand All @@ -42,30 +37,6 @@ PageType {

property bool isFocusable: true

Keys.onTabPressed: {
FocusController.nextKeyTabItem()
}

Keys.onBacktabPressed: {
FocusController.previousKeyTabItem()
}

Keys.onUpPressed: {
FocusController.nextKeyUpItem()
}

Keys.onDownPressed: {
FocusController.nextKeyDownItem()
}

Keys.onLeftPressed: {
FocusController.nextKeyLeftItem()
}

Keys.onRightPressed: {
FocusController.nextKeyRightItem()
}

model: AwgConfigModel

delegate: Item {
Expand Down
Loading

0 comments on commit f41c23f

Please sign in to comment.