Skip to content

Commit

Permalink
Merge branch 'improve_navigation_cpp' into feature/android-tv
Browse files Browse the repository at this point in the history
# Conflicts:
#	client/ui/qml/Components/ShareConnectionDrawer.qml
#	client/ui/qml/Controls2/DrawerType2.qml
#	client/ui/qml/Pages2/PageHome.qml
#	client/ui/qml/Pages2/PageShareFullAccess.qml
  • Loading branch information
albexk committed Nov 24, 2024
2 parents 6ac7414 + 0620b45 commit 2752c05
Show file tree
Hide file tree
Showing 8 changed files with 65 additions and 26 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ jobs:
- name: 'Setup xcode'
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '14.3.1'
xcode-version: '15.4.0'

- name: 'Install Qt'
uses: jurplel/install-qt-action@v3
Expand Down
8 changes: 5 additions & 3 deletions client/ui/qml/Components/ShareConnectionDrawer.qml
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ DrawerType2 {
Layout.rightMargin: 16

text: qsTr("Share")
imageSource: "qrc:/images/controls/share-2.svg"
leftImageSource: "qrc:/images/controls/share-2.svg"

clickedFunc: function() {
var fileName = ""
Expand Down Expand Up @@ -142,7 +142,7 @@ DrawerType2 {
borderWidth: 1

text: qsTr("Copy")
imageSource: "qrc:/images/controls/copy.svg"
leftImageSource: "qrc:/images/controls/copy.svg"

Keys.onReturnPressed: { copyConfigTextButton.clicked() }
Keys.onEnterPressed: { copyConfigTextButton.clicked() }
Expand All @@ -165,7 +165,9 @@ DrawerType2 {
borderWidth: 1

text: qsTr("Copy config string")
imageSource: "qrc:/images/controls/copy.svg"
leftImageSource: "qrc:/images/controls/copy.svg"

KeyNavigation.tab: showSettingsButton
}

BasicButtonType {
Expand Down
22 changes: 14 additions & 8 deletions client/ui/qml/Controls2/BasicButtonType.qml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@ Button {
property int borderWidth: 0
property int borderFocusedWidth: 1

property string imageSource
property string leftImageSource
property string rightImageSource
property string leftImageColor: textColor
property string leftImageColor
property bool changeLeftImageSize: true

property bool squareLeftSide: false

Expand Down Expand Up @@ -153,18 +154,23 @@ Button {
anchors.centerIn: parent

Image {
Layout.preferredHeight: 20
Layout.preferredWidth: 20

source: root.imageSource
visible: root.imageSource === "" ? false : true
id: leftImage
source: root.leftImageSource
visible: root.leftImageSource === "" ? false : true

layer {
enabled: true
enabled: leftImageColor !== "" ? true : false
effect: ColorOverlay {
color: leftImageColor
}
}

Component.onCompleted: {
if (root.changeLeftImageSize) {
leftImage.Layout.preferredHeight = 20
leftImage.Layout.preferredWidth = 20
}
}
}

ButtonTextType {
Expand Down
2 changes: 1 addition & 1 deletion client/ui/qml/Controls2/DrawerType2.qml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ Item {

function onClosed() {
drawerContent.state = root.drawerCollapsedStateName

if (root.isCollapsedStateActive()) {
var initialPageNavigationBarColor = PageController.getInitialPageNavigationBarColor()
if (initialPageNavigationBarColor !== 0xFF1C1D21) {
Expand Down
2 changes: 1 addition & 1 deletion client/ui/qml/Controls2/TextFieldWithHeaderType.qml
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ Item {

focusPolicy: Qt.NoFocus
text: root.buttonText
imageSource: root.buttonImageSource
leftImageSource: root.buttonImageSource

anchors.top: content.top
anchors.bottom: content.bottom
Expand Down
51 changes: 41 additions & 10 deletions client/ui/qml/Pages2/PageHome.qml
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ PageType {
pressedColor: AmneziaStyle.color.sheerWhite
disabledColor: AmneziaStyle.color.mutedGray
textColor: AmneziaStyle.color.mutedGray
leftImageColor: AmneziaStyle.color.transparent
borderWidth: 0

buttonTextLabel.lineHeight: 20
Expand All @@ -109,7 +108,7 @@ PageType {

text: isSplitTunnelingEnabled ? qsTr("Split tunneling enabled") : qsTr("Split tunneling disabled")

imageSource: isSplitTunnelingEnabled ? "qrc:/images/controls/split-tunneling.svg" : ""
leftImageSource: isSplitTunnelingEnabled ? "qrc:/images/controls/split-tunneling.svg" : ""
rightImageSource: "qrc:/images/controls/chevron-down.svg"

Keys.onEnterPressed: splitTunnelingButton.clicked()
Expand Down Expand Up @@ -156,6 +155,7 @@ PageType {

anchors.left: parent.left
anchors.right: parent.right
spacing: 0

Component.onCompleted: {
drawer.collapsedHeight = collapsed.implicitHeight
Expand Down Expand Up @@ -261,18 +261,49 @@ PageType {
RowLayout {
objectName: "rowLayoutLabel"
Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
Layout.bottomMargin: drawer.isCollapsedStateActive ? 44 : ServersModel.isDefaultServerFromApi ? 89 : 44
Layout.topMargin: 8
Layout.bottomMargin: drawer.isCollapsed ? 44 : ServersModel.isDefaultServerFromApi ? 61 : 16
spacing: 0

Image {
Layout.rightMargin: 8
visible: source !== ""
source: ServersModel.defaultServerImagePathCollapsed
BasicButtonType {
enabled: (ServersModel.defaultServerImagePathCollapsed !== "") && drawer.isCollapsed
hoverEnabled: enabled

implicitHeight: 36

leftPadding: 16
rightPadding: 16

defaultColor: AmneziaStyle.color.transparent
hoveredColor: AmneziaStyle.color.translucentWhite
pressedColor: AmneziaStyle.color.sheerWhite
disabledColor: AmneziaStyle.color.transparent
textColor: AmneziaStyle.color.mutedGray

buttonTextLabel.lineHeight: 16
buttonTextLabel.font.pixelSize: 13
buttonTextLabel.font.weight: 400

text: drawer.isCollapsed ? ServersModel.defaultServerDescriptionCollapsed : ServersModel.defaultServerDescriptionExpanded
leftImageSource: ServersModel.defaultServerImagePathCollapsed
changeLeftImageSize: false

rightImageSource: hoverEnabled ? "qrc:/images/controls/chevron-down.svg" : ""

onClicked: {
ServersModel.processedIndex = ServersModel.defaultIndex
PageController.goToPage(PageEnum.PageSettingsServerInfo)
}
}
}
}

LabelTextType {
id: collapsedServerMenuDescription
text: drawer.isCollapsedStateActive ? ServersModel.defaultServerDescriptionCollapsed : ServersModel.defaultServerDescriptionExpanded
Connections {
target: drawer
enabled: !GC.isMobile()
function onIsCollapsedChanged() {
if (!drawer.isCollapsed) {
focusItem1.forceActiveFocus()
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion client/ui/qml/Pages2/PageShare.qml
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,7 @@ PageType {
visible: accessTypeSelector.currentIndex === 0

text: qsTr("Share")
imageSource: "qrc:/images/controls/share-2.svg"
leftImageSource: "qrc:/images/controls/share-2.svg"


parentFlickable: a
Expand Down
2 changes: 1 addition & 1 deletion client/ui/qml/Pages2/PageShareFullAccess.qml
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ PageType {
Layout.topMargin: 40

text: qsTr("Share")
imageSource: "qrc:/images/controls/share-2.svg"
leftImageSource: "qrc:/images/controls/share-2.svg"

clickedFunc: function() {
PageController.showBusyIndicator(true)
Expand Down

0 comments on commit 2752c05

Please sign in to comment.