added PageSettings and PageSettingsServersList.

- replaced PageLoader with PageType with stackView property.
- added error handling when installing a server/container
This commit is contained in:
vladimir.kuznetsov 2023-05-25 15:40:17 +08:00
parent ca6b7fbeb2
commit e00656d757
31 changed files with 486 additions and 142 deletions

View file

@ -36,7 +36,7 @@ Item {
if (backButtonFunction && typeof backButtonFunction === "function") {
backButtonFunction()
} else {
PageController.closePage()
closePage()
}
}
}

View file

@ -36,7 +36,7 @@ Item {
if (backButtonFunction && typeof backButtonFunction === "function") {
backButtonFunction()
} else {
PageController.closePage()
closePage()
}
}
}
@ -61,8 +61,8 @@ Item {
visible: image ? true : false
onClicked: {
if (actionButtonImage && typeof actionButtonImage === "function") {
actionButtonImage()
if (actionButtonFunction && typeof actionButtonFunction === "function") {
actionButtonFunction()
}
}
}

View file

@ -8,7 +8,7 @@ Item {
property string text
property string descriptionText
property var onClickedFunc
property var clickedFunction
property alias buttonImage: button.image
property string iconImage
@ -68,8 +68,8 @@ Item {
hoverEnabled: false
image: buttonImage
onClicked: {
if (onClickedFunc && typeof onClickedFunc === "function") {
onClickedFunc()
if (clickedFunction && typeof clickedFunction === "function") {
clickedFunction()
}
}

View file

@ -0,0 +1,31 @@
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
Item {
id: root
property StackView stackView: StackView.view
function goToPage(page, slide = true) {
if (slide) {
root.stackView.push(PageController.getPagePath(page), {}, StackView.PushTransition)
} else {
root.stackView.push(PageController.getPagePath(page), {}, StackView.Immediate)
}
}
function closePage() {
if (root.stackView.depth <= 1) {
return
}
root.stackView.pop()
}
function goToStartPage() {
while (root.stackView.depth > 1) {
root.stackView.pop()
}
}
}

View file

@ -0,0 +1,61 @@
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import "TextTypes"
Popup {
id: root
property string popupErrorMessageText
property bool closeButtonVisible: true
leftMargin: 25
rightMargin: 25
bottomMargin: 70
width: parent.width - leftMargin - rightMargin
anchors.centerIn: parent
modal: true
closePolicy: Popup.CloseOnEscape
Overlay.modal: Rectangle {
color: Qt.rgba(14/255, 14/255, 17/255, 0.8)
}
background: Rectangle {
anchors.fill: parent
color: Qt.rgba(215/255, 216/255, 219/255, 0.95)
radius: 4
}
contentItem: RowLayout {
width: parent.width
CaptionTextType {
horizontalAlignment: Text.AlignHCenter
Layout.fillWidth: true
text: root.popupErrorMessageText
}
BasicButtonType {
visible: closeButtonVisible
defaultColor: Qt.rgba(215/255, 216/255, 219/255, 0.95)
hoveredColor: "#C1C2C5"
pressedColor: "#AEB0B7"
disabledColor: "#494B50"
textColor: "#0E0E11"
borderWidth: 0
text: "Close"
onClicked: {
root.close()
}
}
}
}

View file

@ -0,0 +1,13 @@
import QtQuick
Text {
height: 16
color: "#0E0E11"
font.pixelSize: 13
font.weight: Font.Normal
font.family: "PT Root UI VF"
font.letterSpacing: 0.02
wrapMode: Text.WordWrap
}