Refactor PageLoader show methods

Also lets the chat page recycling work with showPrevious() (ctrl+tab)
This commit is contained in:
miruka
2020-09-02 15:07:10 -04:00
parent a4bbbfee87
commit e947fe7695
8 changed files with 27 additions and 33 deletions

View File

@@ -111,7 +111,8 @@ HMenu {
text: qsTr("Account settings")
onTriggered: {
pageLoader.showPage(
"AccountSettings/AccountSettings", { "userId": userId },
"Pages/AccountSettings/AccountSettings.qml",
{ "userId": userId },
)
wentToAccountPage()
}
@@ -121,7 +122,7 @@ HMenu {
icon.name: "menu-add-chat"
text: qsTr("Add new chat")
onTriggered: {
pageLoader.showPage("AddChat/AddChat", {userId: userId})
pageLoader.showPage("Pages/AddChat/AddChat.qml", {userId: userId})
wentToAccountPage()
}
}

View File

@@ -146,7 +146,9 @@ HTile {
backgroundColor: "transparent"
toolTip.text: qsTr("Add new chat")
onClicked: {
pageLoader.showPage("AddChat/AddChat", {userId: model.id})
pageLoader.showPage(
"Pages/AddChat/AddChat.qml", {userId: model.id},
)
account.wentToAccountPage()
}

View File

@@ -24,7 +24,7 @@ Rectangle {
toolTip.text: qsTr("Add another account")
backgroundColor: theme.mainPane.bottomBar.settingsButtonBackground
onClicked: {
pageLoader.showPage("AddAccount/AddAccount")
pageLoader.showPage("Pages/AddAccount/AddAccount.qml")
roomList.startCorrectItemSearch()
}

View File

@@ -62,7 +62,7 @@ HListView {
item.type === "Account" ?
pageLoader.showPage(
"AccountSettings/AccountSettings", { "userId": item.id }
"Pages/AccountSettings/AccountSettings.qml", { "userId": item.id },
) :
pageLoader.showRoom(item.for_account, item.id)