Merge branch 'dev' into feature/android-tv

# Conflicts:
#	CMakeLists.txt
This commit is contained in:
albexk 2024-11-25 12:19:52 +03:00
commit 50bd364f29
7 changed files with 52 additions and 25 deletions

View file

@ -256,7 +256,7 @@ jobs:
- name: 'Setup xcode' - name: 'Setup xcode'
uses: maxim-lobanov/setup-xcode@v1 uses: maxim-lobanov/setup-xcode@v1
with: with:
xcode-version: '14.3.1' xcode-version: '15.4.0'
- name: 'Install Qt' - name: 'Install Qt'
uses: jurplel/install-qt-action@v3 uses: jurplel/install-qt-action@v3

View file

@ -84,7 +84,7 @@ DrawerType2 {
Layout.topMargin: 16 Layout.topMargin: 16
text: qsTr("Share") text: qsTr("Share")
imageSource: "qrc:/images/controls/share-2.svg" leftImageSource: "qrc:/images/controls/share-2.svg"
KeyNavigation.tab: copyConfigTextButton KeyNavigation.tab: copyConfigTextButton
@ -120,7 +120,7 @@ DrawerType2 {
borderWidth: 1 borderWidth: 1
text: qsTr("Copy") text: qsTr("Copy")
imageSource: "qrc:/images/controls/copy.svg" leftImageSource: "qrc:/images/controls/copy.svg"
Keys.onReturnPressed: { copyConfigTextButton.clicked() } Keys.onReturnPressed: { copyConfigTextButton.clicked() }
Keys.onEnterPressed: { copyConfigTextButton.clicked() } Keys.onEnterPressed: { copyConfigTextButton.clicked() }
@ -143,7 +143,7 @@ DrawerType2 {
borderWidth: 1 borderWidth: 1
text: qsTr("Copy config string") text: qsTr("Copy config string")
imageSource: "qrc:/images/controls/copy.svg" leftImageSource: "qrc:/images/controls/copy.svg"
KeyNavigation.tab: showSettingsButton KeyNavigation.tab: showSettingsButton
} }

View file

@ -22,9 +22,10 @@ Button {
property int borderWidth: 0 property int borderWidth: 0
property int borderFocusedWidth: 1 property int borderFocusedWidth: 1
property string imageSource property string leftImageSource
property string rightImageSource property string rightImageSource
property string leftImageColor: textColor property string leftImageColor
property bool changeLeftImageSize: true
property bool squareLeftSide: false property bool squareLeftSide: false
@ -127,18 +128,23 @@ Button {
anchors.centerIn: parent anchors.centerIn: parent
Image { Image {
Layout.preferredHeight: 20 id: leftImage
Layout.preferredWidth: 20 source: root.leftImageSource
visible: root.leftImageSource === "" ? false : true
source: root.imageSource
visible: root.imageSource === "" ? false : true
layer { layer {
enabled: true enabled: leftImageColor !== "" ? true : false
effect: ColorOverlay { effect: ColorOverlay {
color: leftImageColor color: leftImageColor
} }
} }
Component.onCompleted: {
if (root.changeLeftImageSize) {
leftImage.Layout.preferredHeight = 20
leftImage.Layout.preferredWidth = 20
}
}
} }
ButtonTextType { ButtonTextType {

View file

@ -183,7 +183,7 @@ Item {
focusPolicy: Qt.NoFocus focusPolicy: Qt.NoFocus
text: root.buttonText text: root.buttonText
imageSource: root.buttonImageSource leftImageSource: root.buttonImageSource
anchors.top: content.top anchors.top: content.top
anchors.bottom: content.bottom anchors.bottom: content.bottom

View file

@ -98,7 +98,6 @@ PageType {
pressedColor: AmneziaStyle.color.sheerWhite pressedColor: AmneziaStyle.color.sheerWhite
disabledColor: AmneziaStyle.color.mutedGray disabledColor: AmneziaStyle.color.mutedGray
textColor: AmneziaStyle.color.mutedGray textColor: AmneziaStyle.color.mutedGray
leftImageColor: AmneziaStyle.color.transparent
borderWidth: 0 borderWidth: 0
buttonTextLabel.lineHeight: 20 buttonTextLabel.lineHeight: 20
@ -110,7 +109,7 @@ PageType {
text: isSplitTunnelingEnabled ? qsTr("Split tunneling enabled") : qsTr("Split tunneling disabled") 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" rightImageSource: "qrc:/images/controls/chevron-down.svg"
Keys.onEnterPressed: splitTunnelingButton.clicked() Keys.onEnterPressed: splitTunnelingButton.clicked()
@ -166,6 +165,7 @@ PageType {
anchors.left: parent.left anchors.left: parent.left
anchors.right: parent.right anchors.right: parent.right
spacing: 0
Component.onCompleted: { Component.onCompleted: {
drawer.collapsedHeight = collapsed.implicitHeight drawer.collapsedHeight = collapsed.implicitHeight
@ -267,18 +267,39 @@ PageType {
RowLayout { RowLayout {
Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
Layout.bottomMargin: drawer.isCollapsed ? 44 : ServersModel.isDefaultServerFromApi ? 89 : 44 Layout.topMargin: 8
Layout.bottomMargin: drawer.isCollapsed ? 44 : ServersModel.isDefaultServerFromApi ? 61 : 16
spacing: 0 spacing: 0
Image { BasicButtonType {
Layout.rightMargin: 8 enabled: (ServersModel.defaultServerImagePathCollapsed !== "") && drawer.isCollapsed
visible: source !== "" hoverEnabled: enabled
source: ServersModel.defaultServerImagePathCollapsed
} 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
LabelTextType {
id: collapsedServerMenuDescription
text: drawer.isCollapsed ? ServersModel.defaultServerDescriptionCollapsed : ServersModel.defaultServerDescriptionExpanded 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)
}
} }
} }
} }

View file

@ -573,7 +573,7 @@ PageType {
visible: accessTypeSelector.currentIndex === 0 visible: accessTypeSelector.currentIndex === 0
text: qsTr("Share") text: qsTr("Share")
imageSource: "qrc:/images/controls/share-2.svg" leftImageSource: "qrc:/images/controls/share-2.svg"
Keys.onTabPressed: lastItemTabClicked(focusItem) Keys.onTabPressed: lastItemTabClicked(focusItem)

View file

@ -135,7 +135,7 @@ PageType {
Layout.topMargin: 40 Layout.topMargin: 40
text: qsTr("Share") text: qsTr("Share")
imageSource: "qrc:/images/controls/share-2.svg" leftImageSource: "qrc:/images/controls/share-2.svg"
Keys.onTabPressed: lastItemTabClicked(focusItem) Keys.onTabPressed: lastItemTabClicked(focusItem)