Merge branch 'dev' into feature/amnezia-wireguard-client-impl
This commit is contained in:
commit
135726f177
52 changed files with 4380 additions and 2197 deletions
|
|
@ -23,6 +23,9 @@ Item {
|
|||
image: backButtonImage
|
||||
imageColor: "#D7D8DB"
|
||||
|
||||
implicitWidth: 40
|
||||
implicitHeight: 40
|
||||
|
||||
onClicked: {
|
||||
if (backButtonFunction && typeof backButtonFunction === "function") {
|
||||
backButtonFunction()
|
||||
|
|
|
|||
|
|
@ -90,6 +90,9 @@ Button {
|
|||
anchors.centerIn: parent
|
||||
|
||||
Image {
|
||||
Layout.preferredHeight: 20
|
||||
Layout.preferredWidth: 20
|
||||
|
||||
source: root.imageSource
|
||||
visible: root.imageSource === "" ? false : true
|
||||
|
||||
|
|
|
|||
|
|
@ -123,4 +123,11 @@ RadioButton {
|
|||
Layout.bottomMargin: 16
|
||||
}
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
enabled: false
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@ import QtQuick.Controls
|
|||
Drawer {
|
||||
id: drawer
|
||||
property bool needCloseButton: true
|
||||
property bool isOpened: false
|
||||
|
||||
Connections {
|
||||
target: PageController
|
||||
|
|
@ -50,51 +49,22 @@ Drawer {
|
|||
if (PageController.getInitialPageNavigationBarColor() !== 0xFF1C1D21) {
|
||||
PageController.updateNavigationBarColor(0xFF1C1D21)
|
||||
}
|
||||
}
|
||||
|
||||
onOpened: {
|
||||
if (needCloseButton) {
|
||||
PageController.drawerOpen()
|
||||
}
|
||||
}
|
||||
|
||||
onAboutToHide: {
|
||||
onClosed: {
|
||||
if (needCloseButton) {
|
||||
PageController.drawerClose()
|
||||
}
|
||||
}
|
||||
|
||||
onOpened: {
|
||||
isOpened = true
|
||||
}
|
||||
|
||||
onClosed: {
|
||||
isOpened = false
|
||||
|
||||
var initialPageNavigationBarColor = PageController.getInitialPageNavigationBarColor()
|
||||
if (initialPageNavigationBarColor !== 0xFF1C1D21) {
|
||||
PageController.updateNavigationBarColor(initialPageNavigationBarColor)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
onPositionChanged: {
|
||||
if (isOpened && (position <= 0.99 && position >= 0.95)) {
|
||||
mouseArea.canceled()
|
||||
drawer.close()
|
||||
mouseArea.exited()
|
||||
dropArea.exited()
|
||||
}
|
||||
}
|
||||
|
||||
DropArea {
|
||||
id: dropArea
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
id: mouseArea
|
||||
anchors.fill: parent
|
||||
|
||||
onPressed: {
|
||||
isOpened = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,6 +24,8 @@ Item {
|
|||
property string rootButtonImage: "qrc:/images/controls/chevron-down.svg"
|
||||
property string rootButtonImageColor: "#D7D8DB"
|
||||
property string rootButtonBackgroundColor: "#1C1D21"
|
||||
property string rootButtonBackgroundHoveredColor: "#1C1D21"
|
||||
property string rootButtonBackgroundPressedColor: "#1C1D21"
|
||||
|
||||
property string rootButtonHoveredBorderColor: "#494B50"
|
||||
property string rootButtonDefaultBorderColor: "#2C2D30"
|
||||
|
|
@ -71,6 +73,10 @@ Item {
|
|||
Behavior on border.color {
|
||||
PropertyAnimation { duration: 200 }
|
||||
}
|
||||
|
||||
Behavior on color {
|
||||
PropertyAnimation { duration: 200 }
|
||||
}
|
||||
}
|
||||
|
||||
RowLayout {
|
||||
|
|
@ -112,6 +118,9 @@ Item {
|
|||
ImageButtonType {
|
||||
Layout.rightMargin: 16
|
||||
|
||||
implicitWidth: 40
|
||||
implicitHeight: 40
|
||||
|
||||
hoverEnabled: false
|
||||
image: rootButtonImage
|
||||
imageColor: rootButtonImageColor
|
||||
|
|
@ -126,12 +135,20 @@ Item {
|
|||
onEntered: {
|
||||
if (menu.visible === false) {
|
||||
rootButtonBackground.border.color = rootButtonHoveredBorderColor
|
||||
rootButtonBackground.color = rootButtonBackgroundHoveredColor
|
||||
}
|
||||
}
|
||||
|
||||
onExited: {
|
||||
if (menu.visible === false) {
|
||||
rootButtonBackground.border.color = rootButtonDefaultBorderColor
|
||||
rootButtonBackground.color = rootButtonBackgroundColor
|
||||
}
|
||||
}
|
||||
|
||||
onPressed: {
|
||||
if (menu.visible === false) {
|
||||
rootButtonBackground.color = pressed ? rootButtonBackgroundPressedColor : entered ? rootButtonHoveredBorderColor : rootButtonDefaultBorderColor
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -31,6 +31,9 @@ Item {
|
|||
ImageButtonType {
|
||||
id: headerActionButton
|
||||
|
||||
implicitWidth: 40
|
||||
implicitHeight: 40
|
||||
|
||||
image: root.actionButtonImage
|
||||
imageColor: "#D7D8DB"
|
||||
|
||||
|
|
|
|||
|
|
@ -36,6 +36,9 @@ Item {
|
|||
ImageButtonType {
|
||||
id: headerActionButton
|
||||
|
||||
implicitWidth: 40
|
||||
implicitHeight: 40
|
||||
|
||||
Layout.alignment: Qt.AlignRight
|
||||
|
||||
image: root.actionButtonImage
|
||||
|
|
|
|||
|
|
@ -15,8 +15,8 @@ Button {
|
|||
property string imageColor: "#878B91"
|
||||
property string disableImageColor: "#2C2D30"
|
||||
|
||||
implicitWidth: 40
|
||||
implicitHeight: 40
|
||||
property alias backgroundColor: background.color
|
||||
property alias backgroundRadius: background.radius
|
||||
|
||||
hoverEnabled: true
|
||||
|
||||
|
|
@ -31,16 +31,16 @@ Button {
|
|||
id: background
|
||||
|
||||
anchors.fill: parent
|
||||
radius: 12
|
||||
color: {
|
||||
if (root.enabled) {
|
||||
if(root.pressed) {
|
||||
if (root.pressed) {
|
||||
return pressedColor
|
||||
}
|
||||
return hovered ? hoveredColor : defaultColor
|
||||
}
|
||||
return defaultColor
|
||||
}
|
||||
radius: 12
|
||||
Behavior on color {
|
||||
PropertyAnimation { duration: 200 }
|
||||
}
|
||||
|
|
|
|||
|
|
@ -119,6 +119,9 @@ Item {
|
|||
ImageButtonType {
|
||||
id: rightImage
|
||||
|
||||
implicitWidth: 40
|
||||
implicitHeight: 40
|
||||
|
||||
hoverEnabled: false
|
||||
image: rightImageSource
|
||||
imageColor: rightImageColor
|
||||
|
|
|
|||
|
|
@ -9,71 +9,99 @@ Rectangle {
|
|||
property alias textArea: textArea
|
||||
property alias textAreaText: textArea.text
|
||||
|
||||
property string borderHoveredColor: "#494B50"
|
||||
property string borderNormalColor: "#2C2D30"
|
||||
property string borderFocusedColor: "#d7d8db"
|
||||
|
||||
height: 148
|
||||
color: "#1C1D21"
|
||||
border.width: 1
|
||||
border.color: "#2C2D30"
|
||||
border.color: getBorderColor(borderNormalColor)
|
||||
radius: 16
|
||||
|
||||
FlickableType {
|
||||
id: fl
|
||||
interactive: false
|
||||
MouseArea {
|
||||
id: parentMouse
|
||||
anchors.fill: parent
|
||||
cursorShape: Qt.IBeamCursor
|
||||
onClicked: textArea.forceActiveFocus()
|
||||
hoverEnabled: true
|
||||
|
||||
anchors.top: parent.top
|
||||
anchors.bottom: parent.bottom
|
||||
contentHeight: textArea.implicitHeight
|
||||
TextArea {
|
||||
id: textArea
|
||||
FlickableType {
|
||||
id: fl
|
||||
interactive: false
|
||||
|
||||
width: parent.width
|
||||
anchors.top: parent.top
|
||||
anchors.bottom: parent.bottom
|
||||
contentHeight: textArea.implicitHeight
|
||||
TextArea {
|
||||
id: textArea
|
||||
|
||||
topPadding: 16
|
||||
leftPadding: 16
|
||||
anchors.topMargin: 16
|
||||
anchors.bottomMargin: 16
|
||||
width: parent.width
|
||||
|
||||
color: "#D7D8DB"
|
||||
selectionColor: "#633303"
|
||||
selectedTextColor: "#D7D8DB"
|
||||
placeholderTextColor: "#878B91"
|
||||
topPadding: 16
|
||||
leftPadding: 16
|
||||
anchors.topMargin: 16
|
||||
anchors.bottomMargin: 16
|
||||
|
||||
font.pixelSize: 16
|
||||
font.weight: Font.Medium
|
||||
font.family: "PT Root UI VF"
|
||||
color: "#D7D8DB"
|
||||
selectionColor: "#633303"
|
||||
selectedTextColor: "#D7D8DB"
|
||||
placeholderTextColor: "#878B91"
|
||||
|
||||
placeholderText: root.placeholderText
|
||||
text: root.text
|
||||
font.pixelSize: 16
|
||||
font.weight: Font.Medium
|
||||
font.family: "PT Root UI VF"
|
||||
|
||||
onCursorVisibleChanged: {
|
||||
if (textArea.cursorVisible) {
|
||||
fl.interactive = true
|
||||
} else {
|
||||
fl.interactive = false
|
||||
placeholderText: root.placeholderText
|
||||
text: root.text
|
||||
|
||||
onCursorVisibleChanged: {
|
||||
if (textArea.cursorVisible) {
|
||||
fl.interactive = true
|
||||
} else {
|
||||
fl.interactive = false
|
||||
}
|
||||
}
|
||||
|
||||
wrapMode: Text.Wrap
|
||||
|
||||
MouseArea {
|
||||
id: textAreaMouse
|
||||
anchors.fill: parent
|
||||
acceptedButtons: Qt.RightButton
|
||||
hoverEnabled: true
|
||||
onClicked: {
|
||||
fl.interactive = true
|
||||
contextMenu.open()
|
||||
}
|
||||
}
|
||||
|
||||
onFocusChanged: {
|
||||
root.border.color = getBorderColor(borderNormalColor)
|
||||
}
|
||||
|
||||
ContextMenuType {
|
||||
id: contextMenu
|
||||
textObj: textArea
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
wrapMode: Text.Wrap
|
||||
onPressed: {
|
||||
root.border.color = getBorderColor(borderFocusedColor)
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
acceptedButtons: Qt.RightButton
|
||||
onClicked: {
|
||||
fl.interactive = true
|
||||
contextMenu.open()
|
||||
}
|
||||
}
|
||||
onExited: {
|
||||
root.border.color = getBorderColor(borderNormalColor)
|
||||
}
|
||||
|
||||
ContextMenuType {
|
||||
id: contextMenu
|
||||
textObj: textArea
|
||||
}
|
||||
onEntered: {
|
||||
root.border.color = getBorderColor(borderHoveredColor)
|
||||
}
|
||||
}
|
||||
|
||||
//todo make whole background clickable, with code below we lose ability to select text by mouse
|
||||
// MouseArea {
|
||||
// anchors.fill: parent
|
||||
// cursorShape: Qt.IBeamCursor
|
||||
// onClicked: textArea.forceActiveFocus()
|
||||
// }
|
||||
|
||||
function getBorderColor(noneFocusedColor) {
|
||||
return textArea.focus ? root.borderFocusedColor : noneFocusedColor
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,6 +31,7 @@ Item {
|
|||
|
||||
property string backgroundColor: "#1c1d21"
|
||||
property string backgroundDisabledColor: "transparent"
|
||||
property string bgBorderHoveredColor: "#494B50"
|
||||
|
||||
implicitWidth: content.implicitWidth
|
||||
implicitHeight: content.implicitHeight
|
||||
|
|
@ -45,7 +46,7 @@ Item {
|
|||
Layout.preferredHeight: input.implicitHeight
|
||||
color: root.enabled ? root.backgroundColor : root.backgroundDisabledColor
|
||||
radius: 16
|
||||
border.color: textField.focus ? root.borderFocusedColor : root.borderColor
|
||||
border.color: getBackgroundBorderColor(root.borderColor)
|
||||
border.width: 1
|
||||
|
||||
Behavior on border.color {
|
||||
|
|
@ -109,12 +110,17 @@ Item {
|
|||
anchors.fill: parent
|
||||
acceptedButtons: Qt.RightButton
|
||||
onClicked: contextMenu.open()
|
||||
enabled: true
|
||||
}
|
||||
|
||||
ContextMenuType {
|
||||
id: contextMenu
|
||||
textObj: textField
|
||||
}
|
||||
|
||||
onFocusChanged: {
|
||||
backgroud.border.color = getBackgroundBorderColor(root.borderColor)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -156,11 +162,28 @@ Item {
|
|||
|
||||
MouseArea {
|
||||
anchors.fill: root
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
cursorShape: Qt.IBeamCursor
|
||||
|
||||
hoverEnabled: true
|
||||
|
||||
onPressed: function(mouse) {
|
||||
textField.forceActiveFocus()
|
||||
mouse.accepted = false
|
||||
|
||||
backgroud.border.color = getBackgroundBorderColor(root.borderColor)
|
||||
}
|
||||
|
||||
onEntered: {
|
||||
backgroud.border.color = getBackgroundBorderColor(bgBorderHoveredColor)
|
||||
}
|
||||
|
||||
|
||||
onExited: {
|
||||
backgroud.border.color = getBackgroundBorderColor(root.borderColor)
|
||||
}
|
||||
}
|
||||
|
||||
function getBackgroundBorderColor(noneFocusedColor) {
|
||||
return textField.focus ? root.borderFocusedColor : noneFocusedColor
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ Text {
|
|||
|
||||
color: "#D7D8DB"
|
||||
font.pixelSize: 16
|
||||
font.weight: 500
|
||||
font.weight: 600
|
||||
font.family: "PT Root UI VF"
|
||||
|
||||
wrapMode: Text.WordWrap
|
||||
|
|
|
|||
|
|
@ -23,6 +23,9 @@ Popup {
|
|||
image: "qrc:/images/svg/close_black_24dp.svg"
|
||||
imageColor: "#D7D8DB"
|
||||
|
||||
implicitWidth: 40
|
||||
implicitHeight: 40
|
||||
|
||||
onClicked: {
|
||||
PageController.goToDrawerRootPage()
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue