(StatusSectionLayout): removed big space between header and content

Closes 7312
This commit is contained in:
Alexandra Betouni 2022-09-13 19:17:54 +03:00 committed by Alexandra Betouni
parent 654519f5dd
commit fc3daa1451
21 changed files with 140 additions and 183 deletions

View File

@ -18,19 +18,20 @@ ToolBar {
signal notificationButtonClicked() signal notificationButtonClicked()
implicitWidth: visible ? 518 : 0 implicitWidth: visible ? 518 : 0
implicitHeight: visible ? 60 : 0 implicitHeight: visible ? 56 : 0
padding: 8 padding: 4
background: null background: null
RowLayout { RowLayout {
anchors.fill: parent anchors.fill: parent
anchors.rightMargin: 4
spacing: 0 spacing: 0
StatusFlatButton { StatusFlatButton {
icon.name: "arrow-left" icon.name: "arrow-left"
icon.width: 20 icon.width: 20
icon.height: 20 icon.height: 20
Layout.alignment: Qt.AlignLeft | Qt.AlignVCenter Layout.alignment: Qt.AlignLeft | Qt.AlignVCenter
Layout.leftMargin: 12 Layout.leftMargin: 18
visible: !!root.backButtonName visible: !!root.backButtonName
text: root.backButtonName text: root.backButtonName
size: StatusBaseButton.Size.Large size: StatusBaseButton.Size.Large
@ -41,6 +42,7 @@ ToolBar {
id: headerContentItem id: headerContentItem
Layout.fillWidth: !!headerContent Layout.fillWidth: !!headerContent
Layout.fillHeight: !!headerContent Layout.fillHeight: !!headerContent
Layout.leftMargin: 8
background: null background: null
contentItem: (!!headerContent) ? headerContent : null contentItem: (!!headerContent) ? headerContent : null
} }

View File

@ -17,7 +17,6 @@ Item {
property Component content property Component content
// optional // optional
property string previousPage
property bool dirty: false property bool dirty: false
property bool editable: false property bool editable: false
@ -26,7 +25,6 @@ Item {
Qt.size(settingsDirtyToastMessage.implicitWidth, Qt.size(settingsDirtyToastMessage.implicitWidth,
settingsDirtyToastMessage.implicitHeight + settingsDirtyToastMessage.anchors.bottomMargin) settingsDirtyToastMessage.implicitHeight + settingsDirtyToastMessage.anchors.bottomMargin)
signal previousPageClicked
signal saveChangesClicked signal saveChangesClicked
signal resetChangesClicked signal resetChangesClicked
@ -48,25 +46,17 @@ Item {
anchors.fill: parent anchors.fill: parent
spacing: 16 spacing: 16
StatusIconTextButton { Item {
implicitHeight: 32 width: parent.width
visible: root.previousPage Layout.preferredHeight: 56
spacing: 8
statusIcon: "arrow"
icon.width: 24
icon.height: 24
text: root.previousPage
font.pixelSize: 15
onClicked: root.previousPageClicked()
}
StatusBaseText {
Layout.leftMargin: 36 Layout.leftMargin: 36
StatusBaseText {
text: root.title anchors.verticalCenter: parent.verticalCenter
color: Theme.palette.directColor1 text: root.title
font.pixelSize: 26 color: Theme.palette.directColor1
font.bold: true font.pixelSize: 26
font.bold: true
}
} }
Loader { Loader {

View File

@ -34,6 +34,14 @@ StackLayout {
property bool editable: false property bool editable: false
property bool owned: false property bool owned: false
function updateState() {
if (editCommunityPage.dirty) {
editCommunityPage.notifyDirty();
} else {
root.currentIndex = 0;
}
}
signal edited(Item item) // item containing edited fields (name, description, logoImagePath, color, options, etc..) signal edited(Item item) // item containing edited fields (name, description, logoImagePath, color, options, etc..)
signal inviteNewPeopleClicked signal inviteNewPeopleClicked
@ -160,7 +168,6 @@ StackLayout {
SettingsPageLayout { SettingsPageLayout {
id: editCommunityPage id: editCommunityPage
previousPage: qsTr("Overview")
title: qsTr("Edit Community") title: qsTr("Edit Community")
editable: true editable: true
@ -205,14 +212,6 @@ StackLayout {
} }
} }
onPreviousPageClicked: {
if (dirty) {
notifyDirty()
} else {
root.currentIndex = 0
}
}
onSaveChangesClicked: { onSaveChangesClicked: {
root.currentIndex = 0 root.currentIndex = 0
root.edited(contentItem) root.edited(contentItem)

View File

@ -6,6 +6,13 @@ import "../../views/communities"
SettingsPageLayout { SettingsPageLayout {
id: root id: root
property string previousPageName
function updateState() {
if (root.state === d.newPermissionViewState) {
root.state = d.welcomeViewState;
}
}
QtObject { QtObject {
id: d id: d
@ -18,23 +25,17 @@ SettingsPageLayout {
State { State {
name: d.welcomeViewState name: d.welcomeViewState
PropertyChanges {target: root; title: qsTr("Permissions")} PropertyChanges {target: root; title: qsTr("Permissions")}
PropertyChanges {target: root; previousPage: ""} PropertyChanges {target: root; previousPageName: ""}
PropertyChanges {target: root; content: welcomeView} PropertyChanges {target: root; content: welcomeView}
}, },
State { State {
name: d.newPermissionViewState name: d.newPermissionViewState
PropertyChanges {target: root; title: qsTr("New permission")} PropertyChanges {target: root; title: qsTr("New permission")}
PropertyChanges {target: root; previousPage: qsTr("Permissions")} PropertyChanges {target: root; previousPageName: qsTr("Permissions")}
PropertyChanges {target: root; content: newPermissionView} PropertyChanges {target: root; content: newPermissionView}
} }
] ]
onPreviousPageClicked: {
if(root.state === d.newPermissionViewState) {
root.state = d.welcomeViewState
}
}
// Community Permissions possible view contents: // Community Permissions possible view contents:
Component { Component {
id: welcomeView id: welcomeView

View File

@ -37,12 +37,8 @@ RowLayout {
Loader { Loader {
id: loader id: loader
Layout.fillWidth: true Layout.fillWidth: d.selectingMembers
Layout.fillHeight: true Layout.fillHeight: true
Layout.alignment: Qt.AlignLeft
Layout.leftMargin: padding
Layout.rightMargin: Style.current.padding
sourceComponent: { sourceComponent: {
if (d.selectingMembers) return membersSelector if (d.selectingMembers) return membersSelector
return statusChatInfoButton return statusChatInfoButton
@ -52,7 +48,6 @@ RowLayout {
RowLayout { RowLayout {
id: actionButtons id: actionButtons
Layout.alignment: Qt.AlignRight Layout.alignment: Qt.AlignRight
Layout.rightMargin: padding
spacing: 8 spacing: 8
visible: !d.selectingMembers visible: !d.selectingMembers

View File

@ -57,14 +57,17 @@ StatusSectionLayout {
signal backToCommunityClicked signal backToCommunityClicked
signal openLegacyPopupClicked // TODO: remove me when migration to new settings is done signal openLegacyPopupClicked // TODO: remove me when migration to new settings is done
leftPanel: Item { onBackButtonClicked: {
centerPanelContentLoader.item.children[d.currentIndex].updateState();
}
leftPanel: ColumnLayout {
anchors.fill: parent anchors.fill: parent
ColumnLayout { ColumnLayout {
anchors { anchors {
top: parent.top top: parent.top
bottom: footer.top bottom: footer.top
topMargin: 16
bottomMargin: 16 bottomMargin: 16
horizontalCenter: parent.horizontalCenter horizontalCenter: parent.horizontalCenter
} }
@ -138,6 +141,7 @@ StatusSectionLayout {
} }
centerPanel: Loader { centerPanel: Loader {
id: centerPanelContentLoader
anchors.fill: parent anchors.fill: parent
//anchors.margins: 32 //anchors.margins: 32
anchors { anchors {
@ -163,7 +167,9 @@ StatusSectionLayout {
archiveSupportEnabled: root.community.historyArchiveSupportEnabled archiveSupportEnabled: root.community.historyArchiveSupportEnabled
requestToJoinEnabled: root.community.access === Constants.communityChatOnRequestAccess requestToJoinEnabled: root.community.access === Constants.communityChatOnRequestAccess
pinMessagesEnabled: root.community.pinMessageAllMembersEnabled pinMessagesEnabled: root.community.pinMessageAllMembersEnabled
onCurrentIndexChanged: {
root.backButtonName = (currentIndex === 1) ? qsTr("Overview") : "";
}
archiveSupportOptionVisible: root.rootStore.isCommunityHistoryArchiveSupportEnabled archiveSupportOptionVisible: root.rootStore.isCommunityHistoryArchiveSupportEnabled
editable: root.community.amISectionAdmin editable: root.community.amISectionAdmin
@ -218,7 +224,11 @@ StatusSectionLayout {
onDeclineRequestToJoin: root.rootStore.declineRequestToJoinCommunity(id) onDeclineRequestToJoin: root.rootStore.declineRequestToJoinCommunity(id)
} }
CommunityPermissionsSettingsPanel {} CommunityPermissionsSettingsPanel {
onStateChanged: {
root.backButtonName = previousPageName;
}
}
} }
} }

View File

@ -47,6 +47,8 @@ StatusSectionLayout {
centerPanel: Item { centerPanel: Item {
implicitWidth: parent.width implicitWidth: parent.width
implicitHeight: parent.height implicitHeight: parent.height
anchors.left: parent.left
anchors.leftMargin: d.layoutHMargin
clip: true clip: true
StatusScrollView { StatusScrollView {
@ -60,7 +62,6 @@ StatusSectionLayout {
spacing: 18 spacing: 18
StatusBaseText { StatusBaseText {
Layout.leftMargin: d.layoutHMargin
text: qsTr("Find community") text: qsTr("Find community")
font.weight: Font.Bold font.weight: Font.Bold
font.pixelSize: d.titlePixelSize font.pixelSize: d.titlePixelSize
@ -75,7 +76,6 @@ StatusSectionLayout {
StatusInput { StatusInput {
id: searcher id: searcher
implicitWidth: 327 implicitWidth: 327
Layout.leftMargin: d.layoutHMargin
Layout.alignment: Qt.AlignVCenter Layout.alignment: Qt.AlignVCenter
enabled: false // Out of scope enabled: false // Out of scope
placeholderText: qsTr("Search") placeholderText: qsTr("Search")
@ -123,12 +123,10 @@ StatusSectionLayout {
CommunityTagsRow { CommunityTagsRow {
tags: root.communitiesStore.communityTags tags: root.communitiesStore.communityTags
Layout.leftMargin: d.layoutHMargin
Layout.fillWidth: true Layout.fillWidth: true
} }
StatusBaseText { StatusBaseText {
Layout.leftMargin: d.layoutHMargin
Layout.topMargin: 20 Layout.topMargin: 20
text: qsTr("Featured") text: qsTr("Featured")
font.weight: Font.Bold font.weight: Font.Bold
@ -138,7 +136,6 @@ StatusSectionLayout {
GridLayout { GridLayout {
id: featuredGrid id: featuredGrid
Layout.leftMargin: d.layoutHMargin
columns: 3 columns: 3
columnSpacing: Style.current.padding columnSpacing: Style.current.padding
rowSpacing: Style.current.padding rowSpacing: Style.current.padding
@ -163,7 +160,6 @@ StatusSectionLayout {
} }
StatusBaseText { StatusBaseText {
Layout.leftMargin: d.layoutHMargin
Layout.topMargin: 20 Layout.topMargin: 20
text: qsTr("Popular") text: qsTr("Popular")
font.weight: Font.Bold font.weight: Font.Bold
@ -172,7 +168,6 @@ StatusSectionLayout {
} }
GridLayout { GridLayout {
Layout.leftMargin: d.layoutHMargin
columns: 3 columns: 3
columnSpacing: Style.current.padding columnSpacing: Style.current.padding
rowSpacing: Style.current.padding rowSpacing: Style.current.padding

View File

@ -21,8 +21,20 @@ StatusSectionLayout {
property var systemPalette property var systemPalette
property var emojiPopup property var emojiPopup
backButtonName: root.store.backButtonName
notificationCount: root.store.unreadNotificationsCount notificationCount: root.store.unreadNotificationsCount
onNotificationButtonClicked: Global.openActivityCenterPopup() onNotificationButtonClicked: Global.openActivityCenterPopup()
onBackButtonClicked: {
switch (profileContainer.currentIndex) {
case 1:
Global.changeAppSectionBySectionType(Constants.appSection.profile, Constants.settingsSubsection.messaging)
break;
case 4:
walletView.resetStack();
break;
}
}
Component.onCompleted: { Component.onCompleted: {
Global.privacyModuleInst = store.privacyStore.privacyModule Global.privacyModuleInst = store.privacyStore.privacyModule
} }
@ -32,8 +44,8 @@ StatusSectionLayout {
readonly property int topMargin: 0 readonly property int topMargin: 0
readonly property int bottomMargin: 56 readonly property int bottomMargin: 56
readonly property int leftMargin: 48 readonly property int leftMargin: 64
readonly property int rightMargin: 48 readonly property int rightMargin: 64
readonly property int contentWidth: 560 readonly property int contentWidth: 560
} }
@ -73,6 +85,11 @@ StatusSectionLayout {
if(visibleChildren[0] === ensContainer){ if(visibleChildren[0] === ensContainer){
ensContainer.goToStart(); ensContainer.goToStart();
} }
if (currentIndex === 1) {
root.store.backButtonName = root.store.getNameForSubsection(Constants.settingsSubsection.messaging);
} else {
root.store.backButtonName = "";
}
} }
MyProfileView { MyProfileView {
@ -92,11 +109,6 @@ StatusSectionLayout {
contactsStore: root.store.contactsStore contactsStore: root.store.contactsStore
sectionTitle: qsTr("Contacts") sectionTitle: qsTr("Contacts")
contentWidth: d.contentWidth contentWidth: d.contentWidth
backButtonName: root.store.getNameForSubsection(Constants.settingsSubsection.messaging)
onBackButtonClicked: {
Global.changeAppSectionBySectionType(Constants.appSection.profile, Constants.settingsSubsection.messaging)
}
} }
EnsView { EnsView {
@ -125,9 +137,10 @@ StatusSectionLayout {
} }
WalletView { WalletView {
id: walletView
implicitWidth: parent.width implicitWidth: parent.width
implicitHeight: parent.height implicitHeight: parent.height
rootStore: root.store
walletStore: root.store.walletStore walletStore: root.store.walletStore
emojiPopup: root.emojiPopup emojiPopup: root.emojiPopup
sectionTitle: root.store.getNameForSubsection(Constants.settingsSubsection.wallet) sectionTitle: root.store.getNameForSubsection(Constants.settingsSubsection.wallet)

View File

@ -5,6 +5,7 @@ import AppLayouts.Chat.stores 1.0
QtObject { QtObject {
id: root id: root
property string backButtonName
property int unreadNotificationsCount: activityCenterList.unreadCount property int unreadNotificationsCount: activityCenterList.unreadCount
property var aboutModuleInst: aboutModule property var aboutModuleInst: aboutModule

View File

@ -66,7 +66,6 @@ SettingsContentBase {
SearchBox { SearchBox {
id: searchBox id: searchBox
anchors.left: parent.left anchors.left: parent.left
anchors.leftMargin: Style.current.padding
anchors.right: parent.right anchors.right: parent.right
placeholderText: qsTr("Search by a display name or chat key") placeholderText: qsTr("Search by a display name or chat key")
} }

View File

@ -20,7 +20,6 @@ Item {
id: sview id: sview
ScrollBar.horizontal.policy: ScrollBar.AlwaysOff ScrollBar.horizontal.policy: ScrollBar.AlwaysOff
anchors.top: parent.top anchors.top: parent.top
anchors.topMargin: 24
anchors.bottom: startBtn.top anchors.bottom: startBtn.top
anchors.bottomMargin: Style.current.padding anchors.bottomMargin: Style.current.padding
anchors.left: parent.left anchors.left: parent.left

View File

@ -16,8 +16,6 @@ Item {
property int contentWidth property int contentWidth
readonly property int contentHeight: (root.height - d.topHeaderHeight - d.titleRowHeight) readonly property int contentHeight: (root.height - d.topHeaderHeight - d.titleRowHeight)
property string backButtonName: ""
property alias titleRowComponentLoader: loader property alias titleRowComponentLoader: loader
property list<Item> headerComponents property list<Item> headerComponents
default property Item content default property Item content
@ -25,7 +23,6 @@ Item {
property bool dirty: false property bool dirty: false
property bool saveChangesButtonEnabled: false property bool saveChangesButtonEnabled: false
signal backButtonClicked()
signal baseAreaClicked() signal baseAreaClicked()
signal saveChangesClicked() signal saveChangesClicked()
signal resetChangesClicked() signal resetChangesClicked()
@ -56,35 +53,10 @@ Item {
} }
} }
Item {
id: topHeader
anchors.left: parent.left
anchors.top: parent.top
anchors.leftMargin: -Style.current.padding
width: root.contentWidth + Style.current.padding
height: d.topHeaderHeight
StatusFlatButton {
anchors.top: parent.top
anchors.left: parent.left
anchors.topMargin: Style.current.halfPadding
visible: root.backButtonName != ""
icon.name: "arrow-left"
icon.width: 20
icon.height: 20
text: root.backButtonName
size: StatusBaseButton.Size.Large
onClicked: root.backButtonClicked()
}
}
RowLayout { RowLayout {
id: titleRow id: titleRow
anchors.left: parent.left width: visible ? root.contentWidth : 0
anchors.top: topHeader.bottom height: visible ? d.titleRowHeight : 0
anchors.leftMargin: Style.current.padding
width: root.contentWidth - Style.current.padding
height: d.titleRowHeight
visible: root.sectionTitle !== "" visible: root.sectionTitle !== ""
StatusBaseText { StatusBaseText {
@ -103,9 +75,8 @@ Item {
StatusScrollView { StatusScrollView {
id: scrollView id: scrollView
objectName: "settingsContentBaseScrollView" objectName: "settingsContentBaseScrollView"
anchors.top: titleRow.visible ? titleRow.bottom : topHeader.bottom anchors.top: titleRow.visible ? titleRow.bottom : parent.top
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
anchors.left: parent.left
anchors.topMargin: Style.current.bigPadding anchors.topMargin: Style.current.bigPadding
padding: 0 padding: 0
width: root.contentWidth width: root.contentWidth

View File

@ -11,7 +11,6 @@ import shared.panels 1.0
import shared.popups 1.0 import shared.popups 1.0
import shared.status 1.0 import shared.status 1.0
import "../stores"
import "../controls" import "../controls"
import "../popups" import "../popups"
import "../panels" import "../panels"
@ -21,15 +20,16 @@ SettingsContentBase {
id: root id: root
property var emojiPopup property var emojiPopup
property WalletStore walletStore property var rootStore
property var walletStore
readonly property int mainViewIndex: 0; readonly property int mainViewIndex: 0;
readonly property int networksViewIndex: 1; readonly property int networksViewIndex: 1;
readonly property int accountViewIndex: 2; readonly property int accountViewIndex: 2;
readonly property int dappPermissionViewIndex: 3; readonly property int dappPermissionViewIndex: 3;
onBackButtonClicked: { function resetStack() {
stackContainer.currentIndex = mainViewIndex stackContainer.currentIndex = mainViewIndex;
} }
StackLayout { StackLayout {
@ -39,22 +39,22 @@ SettingsContentBase {
currentIndex: mainViewIndex currentIndex: mainViewIndex
onCurrentIndexChanged: { onCurrentIndexChanged: {
root.backButtonName = "" root.rootStore.backButtonName = ""
root.sectionTitle = qsTr("Wallet") root.sectionTitle = qsTr("Wallet")
root.titleRowComponentLoader.sourceComponent = undefined root.titleRowComponentLoader.sourceComponent = undefined
if(currentIndex == root.networksViewIndex) { if(currentIndex == root.networksViewIndex) {
root.backButtonName = qsTr("Wallet") root.rootStore.backButtonName = qsTr("Wallet")
root.sectionTitle = qsTr("Networks") root.sectionTitle = qsTr("Networks")
root.titleRowComponentLoader.sourceComponent = testnetModeSwitchComponent root.titleRowComponentLoader.sourceComponent = testnetModeSwitchComponent
} }
else if(currentIndex == root.accountViewIndex) { else if(currentIndex == root.accountViewIndex) {
root.backButtonName = qsTr("Wallet") root.rootStore.backButtonName = qsTr("Wallet")
root.sectionTitle = "" root.sectionTitle = ""
} }
else if(currentIndex == root.dappPermissionViewIndex) { else if(currentIndex == root.dappPermissionViewIndex) {
root.backButtonName = qsTr("Wallet") root.rootStore.backButtonName = qsTr("Wallet")
root.sectionTitle = qsTr("DApp Permissions") root.sectionTitle = qsTr("DApp Permissions")
} }
} }

View File

@ -64,9 +64,13 @@ Item {
anchors.top: seedPhraseWarning.bottom anchors.top: seedPhraseWarning.bottom
height: root.height - seedPhraseWarning.height height: root.height - seedPhraseWarning.height
width: root.width width: root.width
backButtonName: RootStore.backButtonName
notificationCount: RootStore.unreadNotificationsCount notificationCount: RootStore.unreadNotificationsCount
onNotificationButtonClicked: Global.openActivityCenterPopup() onNotificationButtonClicked: Global.openActivityCenterPopup()
onBackButtonClicked: {
rightPanelStackView.currentItem.resetStack();
}
Component.onCompleted: { Component.onCompleted: {
// Read in RootStore // Read in RootStore
// if(RootStore.firstTimeLogin){ // if(RootStore.firstTimeLogin){
@ -105,8 +109,8 @@ Item {
centerPanel: StackView { centerPanel: StackView {
id: rightPanelStackView id: rightPanelStackView
anchors.fill: parent anchors.fill: parent
anchors.leftMargin: 49 anchors.leftMargin: 64
anchors.rightMargin: 49 anchors.rightMargin: 64
initialItem: walletContainer initialItem: walletContainer
replaceEnter: Transition { replaceEnter: Transition {
NumberAnimation { property: "opacity"; from: 0; to: 1; duration: 400; easing.type: Easing.OutCubic } NumberAnimation { property: "opacity"; from: 0; to: 1; duration: 400; easing.type: Easing.OutCubic }

View File

@ -11,8 +11,6 @@ import StatusQ.Controls 0.1
ColumnLayout { ColumnLayout {
id: root id: root
signal goBack()
property alias primaryText: collectibleName.text property alias primaryText: collectibleName.text
property alias secondaryText: collectibleId.text property alias secondaryText: collectibleId.text
property StatusAssetSettings asset: StatusAssetSettings { property StatusAssetSettings asset: StatusAssetSettings {
@ -21,18 +19,6 @@ ColumnLayout {
isImage: true isImage: true
} }
StatusFlatButton {
Layout.topMargin: -Style.current.xlPadding
Layout.leftMargin: -Style.current.xlPadding
visible: root.backButtonName != ""
icon.name: "arrow-left"
icon.width: 20
icon.height: 20
text: qsTr("Assets")
size: StatusBaseButton.Size.Large
onClicked: root.goBack()
}
RowLayout { RowLayout {
spacing: 8 spacing: 8
StatusSmartIdenticon { StatusSmartIdenticon {

View File

@ -13,46 +13,50 @@ import "../popups"
Item { Item {
id: root id: root
implicitWidth: selectRectangle.width implicitWidth: 130
implicitHeight: childrenRect.height implicitHeight: childrenRect.height
property var store property var store
// FIXME this should be a (styled) ComboBox Item {
StatusListItem { id: selectRectangleItem
id: selectRectangle width: parent.width
implicitWidth: 130 height: 56
implicitHeight: 40 // FIXME this should be a (styled) ComboBox
border.width: 1 StatusListItem {
border.color: Theme.palette.directColor7 implicitWidth: parent.width
color: "transparent" implicitHeight: 40
objectName: "networkSelectorButton" anchors.verticalCenter: parent.verticalCenter
leftPadding: 12 border.width: 1
rightPadding: 12 border.color: Theme.palette.directColor7
statusListItemTitle.font.pixelSize: 13 color: "transparent"
statusListItemTitle.font.weight: Font.Medium objectName: "networkSelectorButton"
statusListItemTitle.color: Theme.palette.baseColor1 leftPadding: 12
title: store.enabledNetworks.count === store.allNetworks.count ? qsTr("All networks") : qsTr("%n network(s)", "", store.enabledNetworks.count) rightPadding: 12
components:[ statusListItemTitle.font.pixelSize: 13
StatusIcon { statusListItemTitle.font.weight: Font.Medium
width: 16 statusListItemTitle.color: Theme.palette.baseColor1
height: 16 title: store.enabledNetworks.count === store.allNetworks.count ? qsTr("All networks") : qsTr("%n network(s)", "", store.enabledNetworks.count)
icon: "chevron-down" components:[
color: Theme.palette.baseColor1 StatusIcon {
} width: 16
] height: 16
onClicked: { icon: "chevron-down"
if (selectPopup.opened) { color: Theme.palette.baseColor1
selectPopup.close(); }
} else { ]
selectPopup.open(); onClicked: {
if (selectPopup.opened) {
selectPopup.close();
} else {
selectPopup.open();
}
} }
} }
} }
Row { Row {
anchors.top: selectRectangle.bottom anchors.bottom: parent.bottom
anchors.topMargin: Style.current.halfPadding
anchors.right: parent.right anchors.right: parent.right
spacing: Style.current.smallPadding spacing: Style.current.smallPadding
visible: chainRepeater.count > 0 visible: chainRepeater.count > 0
@ -71,7 +75,7 @@ Item {
NetworkSelectPopup { NetworkSelectPopup {
id: selectPopup id: selectPopup
x: (parent.width - width + 5) x: (parent.width - width + 5)
y: (selectRectangle.height + 5) y: (selectRectangleItem.height + 5)
layer1Networks: store.layer1Networks layer1Networks: store.layer1Networks
layer2Networks: store.layer2Networks layer2Networks: store.layer2Networks
testNetworks: store.testNetworks testNetworks: store.testNetworks

View File

@ -24,23 +24,25 @@ Item {
property var store property var store
property var walletStore property var walletStore
implicitHeight: childrenRect.height implicitHeight: 88
GridLayout { GridLayout {
width: parent.width width: parent.width
rowSpacing: Style.current.halfPadding
columns: 2 columns: 2
// account + balance // account + balance
Row { RowLayout {
Layout.preferredHeight: 56
spacing: Style.current.halfPadding spacing: Style.current.halfPadding
StatusBaseText { StatusBaseText {
objectName: "accountName" objectName: "accountName"
Layout.alignment: Qt.AlignVCenter
font.pixelSize: 28 font.pixelSize: 28
font.bold: true font.bold: true
text: currentAccount.name text: currentAccount.name
} }
StatusBaseText { StatusBaseText {
Layout.alignment: Qt.AlignVCenter
font.pixelSize: 28 font.pixelSize: 28
font.bold: true font.bold: true
color: Theme.palette.baseColor1 color: Theme.palette.baseColor1
@ -52,7 +54,6 @@ Item {
NetworkFilter { NetworkFilter {
id: networkFilter id: networkFilter
Layout.alignment: Qt.AlignTrailing Layout.alignment: Qt.AlignTrailing
Layout.fillHeight: true
Layout.rowSpan: 2 Layout.rowSpan: 2
store: root.walletStore store: root.walletStore
} }

View File

@ -8,6 +8,7 @@ import shared.stores 1.0 as SharedStore
QtObject { QtObject {
id: root id: root
property string backButtonName: ""
property int unreadNotificationsCount: activityCenterList.unreadCount property int unreadNotificationsCount: activityCenterList.unreadCount
property var currentAccount: Constants.isCppApp ? walletSectionAccounts.currentAccount: walletSectionCurrent property var currentAccount: Constants.isCppApp ? walletSectionAccounts.currentAccount: walletSectionCurrent
property var accounts: walletSectionAccounts.model property var accounts: walletSectionAccounts.model

View File

@ -20,6 +20,10 @@ Item {
property var contactsStore property var contactsStore
property var sendModal property var sendModal
function resetStack() {
stack.currentIndex = 0;
}
ColumnLayout { ColumnLayout {
anchors.fill: parent anchors.fill: parent
@ -27,13 +31,14 @@ Item {
id: stack id: stack
Layout.fillWidth: true Layout.fillWidth: true
Layout.preferredHeight: parent.height - footer.height Layout.preferredHeight: parent.height - footer.height
onCurrentIndexChanged: {
RootStore.backButtonName = ((currentIndex === 1) || (currentIndex === 2)) ? qsTr("Assets") : "";
}
ColumnLayout { ColumnLayout {
anchors.fill: parent anchors.fill: parent
WalletHeader { WalletHeader {
Layout.fillWidth: true Layout.fillWidth: true
Layout.leftMargin: Style.current.padding
Layout.rightMargin: Style.current.padding
locale: RootStore.locale locale: RootStore.locale
currency: RootStore.currentCurrency currency: RootStore.currentCurrency
currentAccount: RootStore.currentAccount currentAccount: RootStore.currentAccount
@ -65,7 +70,8 @@ Item {
StackLayout { StackLayout {
Layout.fillWidth: true Layout.fillWidth: true
Layout.fillHeight: true Layout.fillHeight: true
Layout.margins: Style.current.padding Layout.topMargin: Style.current.padding
Layout.bottomMargin: Style.current.padding
currentIndex: walletTabBar.currentIndex currentIndex: walletTabBar.currentIndex
AssetsView { AssetsView {
@ -93,13 +99,11 @@ Item {
CollectibleDetailView { CollectibleDetailView {
Layout.fillWidth: true Layout.fillWidth: true
Layout.fillHeight: true Layout.fillHeight: true
onGoBack: stack.currentIndex = 0
} }
AssetsDetailView { AssetsDetailView {
id: assetDetailView id: assetDetailView
Layout.fillWidth: true Layout.fillWidth: true
Layout.fillHeight: true Layout.fillHeight: true
onGoBack: stack.currentIndex = 0
visible: (stack.currentIndex === 2) visible: (stack.currentIndex === 2)
} }
TransactionDetailView { TransactionDetailView {

View File

@ -15,8 +15,6 @@ import "../../controls"
Item { Item {
id: root id: root
signal goBack()
CollectibleDetailsHeader { CollectibleDetailsHeader {
id: collectibleHeader id: collectibleHeader
anchors.top: parent.top anchors.top: parent.top
@ -26,7 +24,6 @@ Item {
asset.isImage: true asset.isImage: true
primaryText: RootStore.collectiblesStore.name primaryText: RootStore.collectiblesStore.name
secondaryText: RootStore.collectiblesStore.collectibleId secondaryText: RootStore.collectiblesStore.collectibleId
onGoBack: root.goBack()
} }
ColumnLayout { ColumnLayout {

View File

@ -90,21 +90,6 @@ Item {
} }
} }
signal goBack()
StatusFlatButton {
id: backButton
anchors.top: parent.top
anchors.left: parent.left
anchors.topMargin: -Style.current.xlPadding
anchors.leftMargin: -Style.current.xlPadding
icon.name: "arrow-left"
icon.width: 20
icon.height: 20
text: qsTr("Assets")
size: StatusBaseButton.Size.Large
onClicked: root.goBack()
}
AssetsDetailsHeader { AssetsDetailsHeader {
id: tokenDetailsHeader id: tokenDetailsHeader
anchors.top: parent.top anchors.top: parent.top