moved add new server button to main tabbar
This commit is contained in:
parent
e01dd2bf57
commit
042788bec3
4 changed files with 33 additions and 31 deletions
|
|
@ -96,7 +96,7 @@ PageType {
|
||||||
id: dragArea
|
id: dragArea
|
||||||
|
|
||||||
anchors.fill: buttonBackground
|
anchors.fill: buttonBackground
|
||||||
cursorShape: Qt.PointingHandCursor
|
cursorShape: buttonContent.state === "collapsed" ? Qt.PointingHandCursor : Qt.ArrowCursor
|
||||||
hoverEnabled: true
|
hoverEnabled: true
|
||||||
|
|
||||||
drag.target: buttonContent
|
drag.target: buttonContent
|
||||||
|
|
@ -385,18 +385,7 @@ PageType {
|
||||||
Layout.rightMargin: 16
|
Layout.rightMargin: 16
|
||||||
visible: buttonContent.expandedVisibility
|
visible: buttonContent.expandedVisibility
|
||||||
|
|
||||||
actionButtonImage: "qrc:/images/controls/plus.svg"
|
|
||||||
|
|
||||||
headerText: qsTr("Servers")
|
headerText: qsTr("Servers")
|
||||||
|
|
||||||
actionButtonFunction: function() {
|
|
||||||
buttonContent.state = "collapsed"
|
|
||||||
connectionTypeSelection.visible = true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
ConnectionTypeSelectionDrawer {
|
|
||||||
id: connectionTypeSelection
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -34,19 +34,9 @@ PageType {
|
||||||
Layout.leftMargin: 16
|
Layout.leftMargin: 16
|
||||||
Layout.rightMargin: 16
|
Layout.rightMargin: 16
|
||||||
|
|
||||||
actionButtonImage: "qrc:/images/controls/plus.svg"
|
|
||||||
|
|
||||||
headerText: qsTr("Servers")
|
headerText: qsTr("Servers")
|
||||||
|
|
||||||
actionButtonFunction: function() {
|
|
||||||
connectionTypeSelection.visible = true
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
ConnectionTypeSelectionDrawer {
|
|
||||||
id: connectionTypeSelection
|
|
||||||
}
|
|
||||||
|
|
||||||
FlickableType {
|
FlickableType {
|
||||||
anchors.top: header.bottom
|
anchors.top: header.bottom
|
||||||
|
|
|
||||||
|
|
@ -42,11 +42,7 @@ PageType {
|
||||||
|
|
||||||
function onInstallServerFinished(finishedMessage) {
|
function onInstallServerFinished(finishedMessage) {
|
||||||
PageController.goToStartPage()
|
PageController.goToStartPage()
|
||||||
if (stackView.currentItem.objectName === PageController.getPagePath(PageEnum.PageHome)) {
|
if (stackView.currentItem.objectName === PageController.getPagePath(PageEnum.PageSetupWizardStart)) {
|
||||||
PageController.restorePageHomeState()
|
|
||||||
} else if (stackView.currentItem.objectName === PageController.getPagePath(PageEnum.PageSettings)) {
|
|
||||||
PageController.goToPage(PageEnum.PageSettingsServersList, false)
|
|
||||||
} else {
|
|
||||||
PageController.replaceStartPage()
|
PageController.replaceStartPage()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,7 @@ import "./"
|
||||||
import "../Controls2"
|
import "../Controls2"
|
||||||
import "../Controls2/TextTypes"
|
import "../Controls2/TextTypes"
|
||||||
import "../Config"
|
import "../Config"
|
||||||
|
import "../Components"
|
||||||
|
|
||||||
PageType {
|
PageType {
|
||||||
id: root
|
id: root
|
||||||
|
|
@ -17,14 +18,14 @@ PageType {
|
||||||
target: PageController
|
target: PageController
|
||||||
|
|
||||||
function onGoToPageHome() {
|
function onGoToPageHome() {
|
||||||
tabBar.currentIndex = 0
|
tabBar.setCurrentIndex(0)
|
||||||
tabBarStackView.goToTabBarPage(PageEnum.PageHome)
|
tabBarStackView.goToTabBarPage(PageEnum.PageHome)
|
||||||
|
|
||||||
PageController.updateDrawerRootPage(PageEnum.PageHome)
|
PageController.updateDrawerRootPage(PageEnum.PageHome)
|
||||||
}
|
}
|
||||||
|
|
||||||
function onGoToPageSettings() {
|
function onGoToPageSettings() {
|
||||||
tabBar.currentIndex = 2
|
tabBar.setCurrentIndex(2)
|
||||||
tabBarStackView.goToTabBarPage(PageEnum.PageSettings)
|
tabBarStackView.goToTabBarPage(PageEnum.PageSettings)
|
||||||
|
|
||||||
PageController.updateDrawerRootPage(PageEnum.PageSettings)
|
PageController.updateDrawerRootPage(PageEnum.PageSettings)
|
||||||
|
|
@ -70,6 +71,7 @@ PageType {
|
||||||
}
|
}
|
||||||
|
|
||||||
function onGoToStartPage() {
|
function onGoToStartPage() {
|
||||||
|
connectionTypeSelection.close()
|
||||||
while (tabBarStackView.depth > 1) {
|
while (tabBarStackView.depth > 1) {
|
||||||
tabBarStackView.pop()
|
tabBarStackView.pop()
|
||||||
}
|
}
|
||||||
|
|
@ -120,6 +122,8 @@ PageType {
|
||||||
height: root.height - tabBar.implicitHeight
|
height: root.height - tabBar.implicitHeight
|
||||||
|
|
||||||
function goToTabBarPage(page) {
|
function goToTabBarPage(page) {
|
||||||
|
connectionTypeSelection.close()
|
||||||
|
|
||||||
var pagePath = PageController.getPagePath(page)
|
var pagePath = PageController.getPagePath(page)
|
||||||
tabBarStackView.clear(StackView.Immediate)
|
tabBarStackView.clear(StackView.Immediate)
|
||||||
tabBarStackView.replace(pagePath, { "objectName" : pagePath }, StackView.Immediate)
|
tabBarStackView.replace(pagePath, { "objectName" : pagePath }, StackView.Immediate)
|
||||||
|
|
@ -137,14 +141,16 @@ PageType {
|
||||||
TabBar {
|
TabBar {
|
||||||
id: tabBar
|
id: tabBar
|
||||||
|
|
||||||
|
property int previousIndex: 0
|
||||||
|
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
anchors.bottom: parent.bottom
|
anchors.bottom: parent.bottom
|
||||||
|
|
||||||
topPadding: 8
|
topPadding: 8
|
||||||
bottomPadding: 8
|
bottomPadding: 8
|
||||||
leftPadding: shareTabButton.visible ? 96 : 128
|
leftPadding: 96
|
||||||
rightPadding: shareTabButton.visible ? 96 : 128
|
rightPadding: 96
|
||||||
|
|
||||||
background: Shape {
|
background: Shape {
|
||||||
width: parent.width
|
width: parent.width
|
||||||
|
|
@ -171,8 +177,10 @@ PageType {
|
||||||
onClicked: {
|
onClicked: {
|
||||||
tabBarStackView.goToTabBarPage(PageEnum.PageHome)
|
tabBarStackView.goToTabBarPage(PageEnum.PageHome)
|
||||||
ServersModel.currentlyProcessedIndex = ServersModel.defaultIndex
|
ServersModel.currentlyProcessedIndex = ServersModel.defaultIndex
|
||||||
|
tabBar.previousIndex = 0
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
TabImageButtonType {
|
TabImageButtonType {
|
||||||
id: shareTabButton
|
id: shareTabButton
|
||||||
|
|
||||||
|
|
@ -193,13 +201,24 @@ PageType {
|
||||||
image: "qrc:/images/controls/share-2.svg"
|
image: "qrc:/images/controls/share-2.svg"
|
||||||
onClicked: {
|
onClicked: {
|
||||||
tabBarStackView.goToTabBarPage(PageEnum.PageShare)
|
tabBarStackView.goToTabBarPage(PageEnum.PageShare)
|
||||||
|
tabBar.previousIndex = 1
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
TabImageButtonType {
|
TabImageButtonType {
|
||||||
isSelected: tabBar.currentIndex === 2
|
isSelected: tabBar.currentIndex === 2
|
||||||
image: "qrc:/images/controls/settings-2.svg"
|
image: "qrc:/images/controls/settings-2.svg"
|
||||||
onClicked: {
|
onClicked: {
|
||||||
tabBarStackView.goToTabBarPage(PageEnum.PageSettings)
|
tabBarStackView.goToTabBarPage(PageEnum.PageSettings)
|
||||||
|
tabBar.previousIndex = 2
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
TabImageButtonType {
|
||||||
|
isSelected: tabBar.currentIndex === 3
|
||||||
|
image: "qrc:/images/controls/plus.svg"
|
||||||
|
onClicked: {
|
||||||
|
connectionTypeSelection.open()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -215,4 +234,12 @@ PageType {
|
||||||
x: tabBarStackView.width - topCloseButton.width
|
x: tabBarStackView.width - topCloseButton.width
|
||||||
z: 1
|
z: 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ConnectionTypeSelectionDrawer {
|
||||||
|
id: connectionTypeSelection
|
||||||
|
|
||||||
|
onAboutToHide: {
|
||||||
|
tabBar.setCurrentIndex(tabBar.previousIndex)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue