[Popups]: added destroy() function in all popups by default

Also switched StatusModal to derive from StatusDialog instead
of Popup type

Closes #10149
This commit is contained in:
Patryk Osmaczko 2023-05-23 14:46:16 +02:00 committed by Alexandra Betouni
parent cbe290a735
commit 35a2dd5244
77 changed files with 313 additions and 299 deletions

View File

@ -89,32 +89,32 @@ Column {
StatusModal {
id: simpleModal
anchors.centerIn: parent
header.title: "Some Title"
header.subTitle: "Subtitle"
headerSettings.title: "Some Title"
headerSettings.subTitle: "Subtitle"
}
StatusModal {
id: simpleTitleModal
anchors.centerIn: parent
header.title: "Some Title"
headerSettings.title: "Some Title"
}
StatusModal {
id: headerImageModal
anchors.centerIn: parent
header.title: "Some Title"
header.subTitle: "Subtitle"
header.asset.isImage: true
header.asset.name: "qrc:/demoapp/data/profile-image-1.jpeg"
headerSettings.title: "Some Title"
headerSettings.subTitle: "Subtitle"
headerSettings.asset.isImage: true
headerSettings.asset.name: "qrc:/demoapp/data/profile-image-1.jpeg"
}
StatusModal {
id: footerButtonsModal
anchors.centerIn: parent
header.title: "Some Title"
header.subTitle: "Subtitle"
header.asset.isImage: true
header.asset.name: "qrc:/demoapp/data/profile-image-1.jpeg"
headerSettings.title: "Some Title"
headerSettings.subTitle: "Subtitle"
headerSettings.asset.isImage: true
headerSettings.asset.name: "qrc:/demoapp/data/profile-image-1.jpeg"
leftButtons: [
StatusBackButton { }
]
@ -131,10 +131,10 @@ Column {
StatusModal {
id: headerActionButtonModal
anchors.centerIn: parent
header.title: "Some Title"
header.subTitle: "Subtitle"
header.asset.isImage: true
header.asset.name: "qrc:/demoapp/data/profile-image-1.jpeg"
headerSettings.title: "Some Title"
headerSettings.subTitle: "Subtitle"
headerSettings.asset.isImage: true
headerSettings.asset.name: "qrc:/demoapp/data/profile-image-1.jpeg"
headerActionButton: StatusFlatRoundButton {
type: StatusFlatRoundButton.Type.Secondary
@ -162,10 +162,10 @@ Column {
StatusModal {
id: modalExample
anchors.centerIn: parent
header.asset.isImage: true
header.asset.name: "qrc:/demoapp/data/profile-image-1.jpeg"
header.title: "Header"
header.subTitle: "SubTitle"
headerSettings.asset.isImage: true
headerSettings.asset.name: "qrc:/demoapp/data/profile-image-1.jpeg"
headerSettings.title: "Header"
headerSettings.subTitle: "SubTitle"
rightButtons: [
StatusButton {
text: "Button"
@ -200,8 +200,8 @@ Column {
StatusModal {
id: modalWithContentAccess
anchors.centerIn: parent
header.title: "Header"
header.subTitle: "SubTitle"
headerSettings.title: "Header"
headerSettings.subTitle: "SubTitle"
contentItem: StatusBaseText {
id: text
@ -224,10 +224,10 @@ Column {
StatusModal {
id: modalWithLetterIdenticon
anchors.centerIn: parent
header.title: "Header"
header.subTitle: "SubTitle"
header.asset.isLetterIdenticon: true
header.asset.bgColor: "red"
headerSettings.title: "Header"
headerSettings.subTitle: "SubTitle"
headerSettings.asset.isLetterIdenticon: true
headerSettings.asset.bgColor: "red"
contentItem: StatusBaseText {
anchors.centerIn: parent
@ -249,11 +249,11 @@ Column {
StatusModal {
id: modalWithIdenticon
anchors.centerIn: parent
header.title: "Header"
header.subTitle: "SubTitle"
header.asset.name: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAlklEQVR4nOzW0QmDQBAG4SSkl7SUQlJGCrElq9F3QdjjVhh/5nv3cFhY9vUIYQiNITSG0BhCExPynn1gWf9bx498P7/
headerSettings.title: "Header"
headerSettings.subTitle: "SubTitle"
headerSettings.asset.name: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAlklEQVR4nOzW0QmDQBAG4SSkl7SUQlJGCrElq9F3QdjjVhh/5nv3cFhY9vUIYQiNITSG0BhCExPynn1gWf9bx498P7/
nzPcxEzGExhBdJGYihtAYQlO+tUZvqrPbqeudo5iJGEJjCE15a3VtodH3q2ImYgiNITTlTdG1nUZ5a92VITQxITFiJmIIjSE0htAYQrMHAAD//+wwFVpz+yqXAAAAAElFTkSuQmCC"
header.asset.imgIsIdenticon: true
headerSettings.asset.imgIsIdenticon: true
contentItem: StatusBaseText {
anchors.centerIn: parent
@ -275,12 +275,12 @@ Column {
StatusModal {
id: modalWithEditableIdenticon
anchors.centerIn: parent
header.title: "Header"
header.subTitle: "SubTitle"
header.headerImageEditable: true
header.asset.name: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAlklEQVR4nOzW0QmDQBAG4SSkl7SUQlJGCrElq9F3QdjjVhh/5nv3cFhY9vUIYQiNITSG0BhCExPynn1gWf9bx498P7/
headerSettings.title: "Header"
headerSettings.subTitle: "SubTitle"
headerSettings.headerImageEditable: true
headerSettings.asset.name: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAlklEQVR4nOzW0QmDQBAG4SSkl7SUQlJGCrElq9F3QdjjVhh/5nv3cFhY9vUIYQiNITSG0BhCExPynn1gWf9bx498P7/
nzPcxEzGExhBdJGYihtAYQlO+tUZvqrPbqeudo5iJGEJjCE15a3VtodH3q2ImYgiNITTlTdG1nUZ5a92VITQxITFiJmIIjSE0htAYQrMHAAD//+wwFVpz+yqXAAAAAElFTkSuQmCC"
header.asset.imgIsIdenticon: true
headerSettings.asset.imgIsIdenticon: true
contentItem: StatusBaseText {
anchors.centerIn: parent
@ -302,12 +302,12 @@ Column {
StatusModal {
id: modalWithLongTitles
anchors.centerIn: parent
header.title: "Some super long text here that exceeds the available space"
header.subTitle: "Some super long text here that exceeds the available space"
header.subTitleElide: Text.ElideMiddle
header.asset.name: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAlklEQVR4nOzW0QmDQBAG4SSkl7SUQlJGCrElq9F3QdjjVhh/5nv3cFhY9vUIYQiNITSG0BhCExPynn1gWf9bx498P7/
headerSettings.title: "Some super long text here that exceeds the available space"
headerSettings.subTitle: "Some super long text here that exceeds the available space"
headerSettings.subTitleElide: Text.ElideMiddle
headerSettings.asset.name: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAlklEQVR4nOzW0QmDQBAG4SSkl7SUQlJGCrElq9F3QdjjVhh/5nv3cFhY9vUIYQiNITSG0BhCExPynn1gWf9bx498P7/
nzPcxEzGExhBdJGYihtAYQlO+tUZvqrPbqeudo5iJGEJjCE15a3VtodH3q2ImYgiNITTlTdG1nUZ5a92VITQxITFiJmIIjSE0htAYQrMHAAD//+wwFVpz+yqXAAAAAElFTkSuQmCC"
header.asset.imgIsIdenticon: true
headerSettings.asset.imgIsIdenticon: true
contentItem: StatusBaseText {
anchors.centerIn: parent
@ -329,9 +329,9 @@ Column {
StatusModal {
id: modalWithHeaderPopupMenu
anchors.centerIn: parent
header.title: "helloworld.eth"
header.subTitle: "Basic address"
header.popupMenu: StatusMenu {
headerSettings.title: "helloworld.eth"
headerSettings.subTitle: "Basic address"
headerSettings.popupMenu: StatusMenu {
id: popupMenu
StatusMenuInstantiator {
@ -351,8 +351,8 @@ Column {
StatusModal {
id: editTitleModal
anchors.centerIn: parent
header.title: "This title can be edited"
header.editable: true
headerSettings.title: "This title can be edited"
headerSettings.editable: true
}
StatusModal {

View File

@ -11,10 +11,10 @@ StatusModal {
anchors.centerIn: parent
header.title: "Cryptokitties"
header.subTitle: "Public Community"
header.asset.isImage: true
header.asset.name: "qrc:/demoapp/data/profile-image-1.jpeg"
headerSettings.title: "Cryptokitties"
headerSettings.subTitle: "Public Community"
headerSettings.asset.isImage: true
headerSettings.asset.name: "qrc:/demoapp/data/profile-image-1.jpeg"
contentItem: Column {
width: root.width

View File

@ -8,7 +8,7 @@ import StatusQ.Core.Theme 0.1
StatusModal {
id: root
header.title: "Contact Requests"
headerSettings.title: "Contact Requests"
headerActionButton: StatusFlatRoundButton {
type: StatusFlatRoundButton.Type.Secondary
width: 32

View File

@ -189,7 +189,7 @@ Item {
StatusModal {
id: imageCropperModal
header.title: workflowItem.title
headerSettings.title: workflowItem.title
anchors.centerIn: Overlay.overlay

View File

@ -146,7 +146,7 @@ Item {
width: parent.width
model: SortFilterProxyModel {
sourceModel: root.accounts
sourceModel: !!root.accounts ? root.accounts : null
filters: [
ValueFilter {
roleName: "walletType"

View File

@ -11,6 +11,16 @@ Dialog {
id: root
property string subtitle
/*!
\qmlproperty destroyOnClose
This property decides whether the popup component should be destroyed when closed. Default value is true.
*/
property bool destroyOnClose: true
/*!
\qmlproperty color backgroundColor
This property decides the modal background color
*/
property string backgroundColor: Theme.palette.statusModal.backgroundColor
anchors.centerIn: Overlay.overlay
@ -24,7 +34,9 @@ Dialog {
color: Theme.palette.backdropColor
}
background: StatusDialogBackground {}
background: StatusDialogBackground {
color: root.backgroundColor
}
header: StatusDialogHeader {
visible: root.title || root.subtitle
@ -101,4 +113,9 @@ Dialog {
}
}
}
onClosed: {
if (root.destroyOnClose)
root.destroy();
}
}

View File

@ -1,9 +1,10 @@
import QtQuick 2.14
import QtQuick.Controls 2.14 as QC
import QtQuick.Controls 2.14
import StatusQ.Core 0.1
import StatusQ.Core.Theme 0.1
import StatusQ.Controls 0.1
import StatusQ.Popups.Dialog 0.1
import "statusModal" as Spares
@ -19,8 +20,8 @@ import "statusModal" as Spares
\qml
StatusModal {
anchors.centerIn: parent
header.title: "Some Title"
header.subTitle: "Subtitle"
headerSettings.title: "Some Title"
headerSettings.subTitle: "Subtitle"
headerActionButton: StatusFlatRoundButton {
type: StatusFlatRoundButton.Type.Secondary
width: 32
@ -50,9 +51,7 @@ import "statusModal" as Spares
For a list of components available see StatusQ.
*/
// Deprecation annotations come with Qt6.2
// @Deprecated { reason: "Use StatusDialog instead, see reasoning: https://github.com/status-im/StatusQ/issues/720" }
QC.Popup {
StatusDialog {
id: root
/*!
@ -135,7 +134,7 @@ QC.Popup {
type: StatusModalHeaderSettings
This property exposes the different properties of the standard header.
*/
property StatusModalHeaderSettings header: StatusModalHeaderSettings {}
property StatusModalHeaderSettings headerSettings: StatusModalHeaderSettings {}
/*!
\qmlproperty rightButtons
This property helps user assign the right buttons on the footer.
@ -182,17 +181,16 @@ QC.Popup {
This property decides whether the advanced header has floating buttons on top of the Modal
*/
property bool hasFloatingButtons: false
/*!
\qmlproperty color backgroundColor
This property decides the modal background color
\qmlproperty destroyOnClose
This property decides whether the popup component should be destroyed when closed. Default value is true.
*/
property string backgroundColor: Theme.palette.statusModal.backgroundColor
property bool destroyOnClose: true
signal editButtonClicked()
signal headerImageClicked()
parent: QC.Overlay.overlay
width: 480
padding: 0
@ -201,18 +199,7 @@ QC.Popup {
leftPadding: padding
rightPadding: padding
margins: 64
modal: true
QC.Overlay.modal: Rectangle {
color: Theme.palette.backdropColor
}
background: Rectangle {
color: root.backgroundColor
radius: 8
header: Item {
Spares.StatusModalHeader {
id: headerImpl
anchors.top: parent.top
@ -220,14 +207,14 @@ QC.Popup {
height: visible ? implicitHeight : 0
visible: root.showHeader
title: header.title
titleElide: header.titleElide
subTitle: header.subTitle
subTitleElide: header.subTitleElide
asset: header.asset
popupMenu: header.popupMenu
headerImageEditable: header.headerImageEditable
editable: header.editable
title: headerSettings.title
titleElide: headerSettings.titleElide
subTitle: headerSettings.subTitle
subTitleElide: headerSettings.subTitleElide
asset: headerSettings.asset
popupMenu: headerSettings.popupMenu
headerImageEditable: headerSettings.headerImageEditable
editable: headerSettings.editable
onEditButtonClicked: root.editButtonClicked()
onHeaderImageClicked: root.headerImageClicked()
@ -241,7 +228,9 @@ QC.Popup {
width: visible ? parent.width : 0
active: root.showAdvancedHeader
}
}
footer: Item {
Spares.StatusModalFooter {
id: footerImpl
anchors.bottom: parent.bottom

View File

@ -13,7 +13,6 @@ StatusModal {
id: root
width: 700
height: !!searchResults && searchResults.count >= 0 && searchText !== "" ? 560 : 122
anchors.centerIn: parent
showHeader: false
showFooter: false

View File

@ -63,7 +63,7 @@ StatusModal {
onCurrentIndexChanged: updateRightButtons()
onReplaceItemChanged: updateRightButtons()
header.title: replaceLoader.item && typeof(replaceLoader.item.title) != "undefined"
headerSettings.title: replaceLoader.item && typeof(replaceLoader.item.title) != "undefined"
? replaceLoader.item.title : stackTitle
padding: 16

View File

@ -204,6 +204,8 @@ StatusSectionLayout {
BrowserHeader {
id: browserHeader
property bool walletMenuPopupOpen: false
anchors.top: parent.top
anchors.topMargin: tabs.tabHeight + tabs.anchors.topMargin
z: 52
@ -212,7 +214,6 @@ StatusSectionLayout {
dappBrowserAccName: WalletStore.dappBrowserAccount.name
dappBrowserAccIcon: WalletStore.dappBrowserAccount.color
settingMenu: settingsMenu
walletMenu: browserWalletMenu
currentUrl: !!_internal.currentWebView ? _internal.currentWebView.url : ""
isLoading: (!!_internal.currentWebView && _internal.currentWebView.loading)
canGoBack: (!!_internal.currentWebView && _internal.currentWebView.canGoBack)
@ -248,6 +249,10 @@ StatusSectionLayout {
}
_internal.currentWebView.url = _internal.determineRealURL(url);
}
onOpenWalletMenu: {
walletMenuPopupOpen ? Global.closePopup() : Global.openPopup(browserWalletMenu);
walletMenuPopupOpen = !walletMenuPopupOpen;
}
}
BrowserTabView {
@ -423,25 +428,32 @@ StatusSectionLayout {
Global.changeAppSectionBySectionType(Constants.appSection.profile, Constants.settingsSubsection.browserSettings);
}
}
BrowserWalletMenu {
Component {
id: browserWalletMenu
y: browserHeader.height + browserHeader.anchors.topMargin
x: parent.width - width - Style.current.halfPadding
onSendTriggered: {
sendTransactionModal.selectedAccount = selectedAccount
sendTransactionModal.open()
}
onReload: {
for (let i = 0; i < tabs.count; ++i){
tabs.getTab(i).item.reload();
BrowserWalletMenu {
property point headerPoint: Qt.point(browserHeader.x, browserHeader.y)
x: (parent.width - width - Style.current.halfPadding)
y: (Math.abs(browserHeader.mapFromGlobal(headerPoint).y) +
browserHeader.anchors.topMargin + Style.current.halfPadding)
onSendTriggered: {
sendTransactionModal.selectedAccount = selectedAccount
sendTransactionModal.open()
}
onReload: {
for (let i = 0; i < tabs.count; ++i){
tabs.getTab(i).item.reload();
}
}
onDisconnect: {
Web3ProviderStore.disconnect(Utils.getHostname(browserHeader.addressBar.text))
provider.postMessage("web3-disconnect-account", "{}");
_internal.currentWebView.reload()
close()
}
Component.onDestruction: {
if (browserHeader.walletMenuPopupOpen)
browserHeader.walletMenuPopupOpen = false;
}
}
onDisconnect: {
Web3ProviderStore.disconnect(Utils.getHostname(browserHeader.addressBar.text))
provider.postMessage("web3-disconnect-account", "{}");
_internal.currentWebView.reload()
close()
}
}
}

View File

@ -15,7 +15,7 @@ import "../popups"
import "../controls"
Rectangle {
id: browserHeader
id: root
property alias favoriteComponent: favoritesBarLoader.sourceComponent
property alias addressBar: addressBar
@ -29,7 +29,6 @@ Rectangle {
property string dappBrowserAccName: ""
property string dappBrowserAccIcon: ""
property var settingMenu
property var walletMenu
signal addNewFavoritelClicked(var xPos)
signal launchInBrowser(var url)
@ -38,6 +37,7 @@ Rectangle {
signal goBack()
signal reload()
signal stopLoading()
signal openWalletMenu()
QtObject {
id: _internal
@ -129,7 +129,7 @@ Rectangle {
anchors.right: reloadBtn.left
anchors.rightMargin: Style.current.halfPadding
visible: !!currentUrl
icon.source: !!browserHeader.currentFavorite ? Style.svg("browser/favoriteActive") : Style.svg("browser/favorite")
icon.source: !!root.currentFavorite ? Style.svg("browser/favoriteActive") : Style.svg("browser/favorite")
color: "transparent"
type: StatusFlatRoundButton.Type.Tertiary
onClicked: addNewFavoritelClicked(addFavoriteBtn.x)
@ -150,6 +150,8 @@ Rectangle {
}
Loader {
Layout.preferredWidth: 44
Layout.preferredHeight: 44
active: true
sourceComponent: currentTabConnected ? connectedBtnComponent : notConnectedBtnCompoent
}
@ -164,12 +166,8 @@ Rectangle {
icon.height: 24
icon.name: "filled-account"
type: StatusFlatRoundButton.Type.Tertiary
onClicked: {
if (walletMenu.opened) {
walletMenu.close()
} else {
walletMenu.open()
}
onPressed: {
root.openWalletMenu()
}
}
}
@ -183,12 +181,8 @@ Rectangle {
icon.height: 18
icon.color: dappBrowserAccIcon
text: dappBrowserAccName
onClicked: {
if (walletMenu.opened) {
walletMenu.close()
} else {
walletMenu.open()
}
onPressed: {
root.openWalletMenu();
}
}
}

View File

@ -13,7 +13,7 @@ import utils 1.0
import "../stores"
// TODO: replace with StatusMenu
Popup {
Dialog {
id: popup
signal sendTriggered(var selectedAccount)
@ -212,4 +212,7 @@ Popup {
}
}
}
onClosed: {
popup.destroy();
}
}

View File

@ -35,7 +35,7 @@ StatusModal {
anchors.centerIn: parent
id: root
header.title: qsTr("Signature request")
headerSettings.title: qsTr("Signature request")
height: 504
onClosed: {

View File

@ -286,5 +286,8 @@ Item {
onCountChanged: currentIndex = 0
}
}
onClosed: {
suggestionsDialog.destroy();
}
}
}

View File

@ -204,7 +204,7 @@ SettingsPageLayout {
anchors.centerIn: parent
width: 400
header.title: qsTr("Ban %1").arg(userNameToBan)
headerSettings.title: qsTr("Ban %1").arg(userNameToBan)
contentItem: StatusBaseText {
id: banContentText
@ -245,7 +245,7 @@ SettingsPageLayout {
anchors.centerIn: parent
width: 400
header.title: qsTr("Kick %1").arg(userNameToKick)
headerSettings.title: qsTr("Kick %1").arg(userNameToKick)
contentItem: StatusBaseText {
id: kickContentText

View File

@ -24,7 +24,7 @@ StatusModal {
id: root
anchors.centerIn: parent
header.title: root.commandTitle
headerSettings.title: root.commandTitle
height: 504
property alias selectRecipient: selectRecipient
@ -40,7 +40,7 @@ StatusModal {
anchors.rightMargin: Style.current.padding
onGroupActivated: {
root.header.title = group.headerText
root.headerSettings.title = group.headerText
btnNext.text = group.footerText
}
TransactionFormGroup {

View File

@ -24,12 +24,12 @@ StatusModal {
}
}
header.title: contentItem.currentItem.headerTitle
header.subTitle: contentItem.currentItem.headerSubtitle || ""
header.asset.name: contentItem.currentItem.headerImageSource || ""
header.asset.isImage: !!contentItem.currentItem.headerImageSource
header.asset.isLetterIdenticon: contentItem.currentItem.headerTitle === root.community.name && !contentItem.currentItem.headerImageSource
header.asset.bgColor: root.community.color
headerSettings.title: contentItem.currentItem.headerTitle
headerSettings.subTitle: contentItem.currentItem.headerSubtitle || ""
headerSettings.asset.name: contentItem.currentItem.headerImageSource || ""
headerSettings.asset.isImage: !!contentItem.currentItem.headerImageSource
headerSettings.asset.isLetterIdenticon: contentItem.currentItem.headerTitle === root.community.name && !contentItem.currentItem.headerImageSource
headerSettings.asset.bgColor: root.community.color
contentItem: StackView {
id: stack
@ -77,9 +77,6 @@ StatusModal {
id: transferOwnershiproot
TransferOwnershipPopup {
anchors.centerIn: parent
onClosed: {
destroy()
}
}
}

View File

@ -42,7 +42,7 @@ StatusModal {
return contentItem.categoryName.valid
}
header.title: isEdit ? qsTr("Edit category") : qsTr("New category")
headerSettings.title: isEdit ? qsTr("Edit category") : qsTr("New category")
contentItem: Column {
property alias categoryName: nameInput
@ -196,7 +196,7 @@ StatusModal {
text: qsTr("Delete Category")
onClicked: {
Global.openPopup(deleteCategoryConfirmationDialogComponent, {
"header.title": qsTr("Delete '%1' category").arg(nameInput.text),
"headerSettings.title": qsTr("Delete '%1' category").arg(nameInput.text),
confirmationText: qsTr("Are you sure you want to delete '%1' category? Channels inside the category wont be deleted.").arg(nameInput.text)
})
}

View File

@ -201,7 +201,7 @@ StatusDialog {
id: colorDialog
anchors.centerIn: parent
property bool colorSelected: root.isEdit && root.channelColor
header.title: qsTr("Channel Colour")
headerSettings.title: qsTr("Channel Colour")
color: root.isEdit && root.channelColor ? root.channelColor :
Theme.palette.primaryColor1
onAccepted: colorSelected = true

View File

@ -155,7 +155,7 @@ Item {
sendChatCommand: root.requestAddressForTransaction
isRequested: false
commandTitle: qsTr("Send")
header.title: commandTitle
headerSettings.title: commandTitle
finalButtonLabel: qsTr("Request Address")
selectRecipient.selectedRecipient: {
parentModule.prepareChatContentModuleForChatId(activeChatId)
@ -187,7 +187,7 @@ Item {
sendChatCommand: root.requestTransaction
isRequested: true
commandTitle: qsTr("Request")
header.title: commandTitle
headerSettings.title: commandTitle
finalButtonLabel: qsTr("Request")
selectRecipient.selectedRecipient: {
parentModule.prepareChatContentModuleForChatId(activeChatId)

View File

@ -257,7 +257,7 @@ StatusMenu {
ConfirmationDialog {
confirmButtonObjectName: "deleteChatConfirmationDialogDeleteButton"
btnType: "warn"
header.title: root.isCommunityChat ? qsTr("Delete #%1").arg(root.chatName) :
headerSettings.title: root.isCommunityChat ? qsTr("Delete #%1").arg(root.chatName) :
root.chatType === Constants.chatType.oneToOne ?
qsTr("Delete chat") :
qsTr("Leave chat")

View File

@ -87,7 +87,7 @@ StatusScrollView {
ConfirmationDialog {
id: declineAllDialog
header.title: qsTr("Sure you want to delete permission")
headerSettings.title: qsTr("Sure you want to delete permission")
confirmationText: qsTr("If you delete this permission, any of your community members who rely on this permission will lose the access this permission gives them.")
onConfirmButtonClicked: {

View File

@ -338,7 +338,7 @@ StatusScrollView {
id: cancelConfirmationPopupCmp
ConfirmationDialog {
id: cancelConfirmationPopup
header.title: qsTr("Are you sure you want to cancel the import?")
headerSettings.title: qsTr("Are you sure you want to cancel the import?")
confirmationText: qsTr("Your new Status community will be deleted and all information entered will be lost.")
showCancelButton: true
cancelBtnType: "default"

View File

@ -182,10 +182,10 @@ following the \"Add existing Status user\" flow, using your seed phrase.")
}
function onDisplayKeycardSharedModuleFlow() {
keycardPopup.active = true
Global.openPopup(keycardPopup);
}
function onDestroyKeycardSharedModuleFlow() {
keycardPopup.active = false
Global.closePopup();
}
}
@ -339,16 +339,11 @@ following the \"Add existing Status user\" flow, using your seed phrase.")
}
}
Loader {
Component {
id: keycardPopup
active: false
sourceComponent: KeycardPopup {
KeycardPopup {
anchors.centerIn: parent
sharedKeycardModule: root.startupStore.startupModuleInst.keycardSharedModule
}
onLoaded: {
keycardPopup.item.open()
}
}
}

View File

@ -22,7 +22,7 @@ StatusModal {
signal submitBtnClicked(string pin)
id: popup
header.title: qsTr("Create PIN")
headerSettings.title: qsTr("Create PIN")
anchors.centerIn: parent
height: 500

View File

@ -30,7 +30,7 @@ RadioButtonSelector {
Component {
id: confirmDialogComponent
ConfirmationDialog {
header.title: qsTr("Warning!")
headerSettings.title: qsTr("Warning!")
confirmationText: qsTr("Change fleet to %1").arg(root.newFleet)
onConfirmButtonClicked: {
root.advancedStore.setFleet(root.newFleet)

View File

@ -78,7 +78,7 @@ StatusListView {
property string communityId: ""
anchors.centerIn: parent
header.title: qsTr("Leave %1").arg(community)
headerSettings.title: qsTr("Leave %1").arg(community)
contentItem: Item {
implicitWidth: 368
implicitHeight: msg.implicitHeight + 32

View File

@ -22,7 +22,7 @@ StatusStackModal {
anchors.centerIn: parent
padding: currentIndex === 0 ? 0 : Style.current.padding
header.title: qsTr("Add more links")
headerSettings.title: qsTr("Add more links")
rightButtons: [finishButton]
finishButton: StatusButton {
text: qsTr("Add")

View File

@ -20,7 +20,7 @@ StatusModal {
anchors.centerIn: parent
height: 560
padding: 8
header.title: qsTr("Waku nodes")
headerSettings.title: qsTr("Waku nodes")
onClosed: {
destroy()

View File

@ -17,7 +17,7 @@ StatusModal {
anchors.centerIn: parent
height: 560
padding: 8
header.title: qsTr("Waku nodes")
headerSettings.title: qsTr("Waku nodes")
property var messagingStore
property var advancedStore

View File

@ -62,7 +62,7 @@ StatusStackModal {
implicitHeight: 748
width: 480
header.title: qsTr("Back up your seed phrase")
headerSettings.title: qsTr("Back up your seed phrase")
rightButtons: [ d.skipButton, nextButton, finishButton ]
nextButton: StatusButton {

View File

@ -64,7 +64,7 @@ StatusModal {
height: 546
closePolicy: submitBtn.loading? Popup.NoAutoClose : Popup.CloseOnEscape | Popup.CloseOnPressOutside
hasCloseButton: !submitBtn.loading
header.title: qsTr("Change password")
headerSettings.title: qsTr("Change password")
onOpened: view.reset()

View File

@ -28,8 +28,8 @@ StatusModal {
globalMentions: Constants.settingsSection.notifications.sendAlertsValue,
otherMessages: Constants.settingsSection.notifications.turnOffValue
})
header.title: qsTr("%1 exemption").arg(root.item.name)
header.asset: StatusAssetSettings {
headerSettings.title: qsTr("%1 exemption").arg(root.item.name)
headerSettings.asset: StatusAssetSettings {
// Once we introduce StatusSmartIdenticon in popup header, we should use the folowing
// color: root.item.type === Constants.settingsSection.exemptions.oneToOneChat?
// Theme.palette.userCustomizationColors[Utils.colorIdForPubkey(root.item.itemId)] :

View File

@ -23,7 +23,7 @@ StatusModal {
property var account
property var emojiPopup
header.title: qsTr("Rename %1").arg(popup.account.name)
headerSettings.title: qsTr("Rename %1").arg(popup.account.name)
property int marginBetweenInputs: 30

View File

@ -15,7 +15,7 @@ StatusModal {
property var contactsStore
header.title: qsTr("Send Contact Request to chat key")
headerSettings.title: qsTr("Send Contact Request to chat key")
QtObject {
id: d

View File

@ -23,7 +23,7 @@ StatusModal {
anchors.centerIn: parent
height: 560
padding: 8
header.title: qsTr("Waku nodes")
headerSettings.title: qsTr("Waku nodes")
property var messagingStore
property var advancedStore

View File

@ -23,7 +23,7 @@ StatusModal {
anchors.centerIn: parent
height: 560
padding: 8
header.title: qsTr("History Nodes")
headerSettings.title: qsTr("History Nodes")
property var messagingStore
property var advancedStore

View File

@ -204,7 +204,7 @@ SettingsContentBase {
property string mode: "normal"
id: confirmDialog
header.title: qsTr("Warning!")
headerSettings.title: qsTr("Warning!")
confirmationText: qsTr("The account will be logged out. When you login again, the selected mode will be enabled")
onConfirmButtonClicked: {
root.advancedStore.setBloomLevel(mode)
@ -549,7 +549,7 @@ SettingsContentBase {
onClosed: destroy()
anchors.centerIn: parent
width: 400
header.title: qsTr("How many log files do you want to keep archived?")
headerSettings.title: qsTr("How many log files do you want to keep archived?")
contentItem: Column {
width: parent.width

View File

@ -29,7 +29,7 @@ SettingsContentBase {
objectName: "ContactsView_ContactRequest_Button"
text: qsTr("Send contact request to chat key")
onClicked: {
sendContactRequest.open()
Global.openPopup(sendContactRequest);
}
}
@ -311,26 +311,10 @@ SettingsContentBase {
}
}
Loader {
Component {
id: sendContactRequest
width: parent.width
height: parent.height
active: false
function open() {
active = true
sendContactRequest.item.open()
}
function close() {
active = false
}
sourceComponent: SendContactRequestModal {
anchors.centerIn: parent
SendContactRequestModal {
contactsStore: root.contactsStore
onClosed: {
sendContactRequest.close();
}
}
}
}

View File

@ -249,9 +249,6 @@ Item {
ENSPopup {
ensUsernamesStore: root.ensUsernamesStore
onClosed: {
destroy()
}
}
}
}

View File

@ -94,28 +94,22 @@ SettingsContentBase {
target: root.keycardStore.keycardModule
function onDisplayKeycardSharedModuleFlow() {
keycardPopup.active = true
Global.openPopup(keycardPopup);
}
function onDestroyKeycardSharedModuleFlow() {
keycardPopup.active = false
Global.closePopup();
}
function onSharedModuleBusy() {
Global.openPopup(sharedModuleBusyPopupComponent)
}
}
Loader {
Component {
id: keycardPopup
active: false
sourceComponent: KeycardPopup {
anchors.centerIn: parent
KeycardPopup {
sharedKeycardModule: root.keycardStore.keycardModule.keycardSharedModule
emojiPopup: root.emojiPopup
}
onLoaded: {
keycardPopup.item.open()
}
}
}
}

View File

@ -193,7 +193,7 @@ SettingsContentBase {
id: languageConfirmationDialog
active: false
sourceComponent: ConfirmationDialog {
header.title: qsTr("Change language")
headerSettings.title: qsTr("Change language")
confirmationText: qsTr("Display language has been changed. You must restart the application for changes to take effect.")
confirmButtonLabel: qsTr("Close the app now")
onConfirmButtonClicked: {

View File

@ -72,7 +72,7 @@ Item {
ConfirmationDialog {
id: confirmDialog
confirmButtonObjectName: "signOutConfirmation"
header.title: qsTr("Sign out")
headerSettings.title: qsTr("Sign out")
confirmationText: qsTr("Make sure you have your account password and seed phrase stored. Without them you can lock yourself out of your account and lose funds.")
confirmButtonLabel: qsTr("Sign out & Quit")
onConfirmButtonClicked: {

View File

@ -30,7 +30,7 @@ SettingsContentBase {
titleRowComponentLoader.sourceComponent: StatusButton {
objectName: "profileSettingsChangePasswordButton"
text: qsTr("Change Password")
onClicked: changePasswordModal.open()
onClicked: Global.openPopup(changePasswordModal)
enabled: !userProfile.isKeycardUser
}
@ -92,16 +92,17 @@ SettingsContentBase {
}
}
ChangePasswordModal {
Component {
id: changePasswordModal
privacyStore: root.privacyStore
anchors.centerIn: parent
onPasswordChanged: successPopup.open()
ChangePasswordModal {
privacyStore: root.privacyStore
onPasswordChanged: Global.openPopup(successPopup);
}
}
ChangePasswordSuccessModal {
Component {
id: successPopup
anchors.centerIn: parent
ChangePasswordSuccessModal { }
}
}
}

View File

@ -155,7 +155,7 @@ Item {
ConfirmationDialog {
id: confirmationPopup
confirmButtonObjectName: "confirmDeleteAccountButton"
header.title: qsTr("Confirm %1 Removal").arg(root.account ? root.account.name : "")
headerSettings.title: qsTr("Confirm %1 Removal").arg(root.account ? root.account.name : "")
confirmationText: qsTr("You will not be able to restore viewing access to this account in the future unless you enter this accounts address again.")
confirmButtonLabel: qsTr("Remove Account")
onConfirmButtonClicked: {

View File

@ -20,7 +20,7 @@ StatusModal {
closePolicy: root.store.disablePopup? Popup.NoAutoClose : Popup.CloseOnEscape | Popup.CloseOnPressOutside
hasCloseButton: !root.store.disablePopup
header.title: root.store.editMode? qsTr("Edit account") : qsTr("Add a new account")
headerSettings.title: root.store.editMode? qsTr("Edit account") : qsTr("Add a new account")
onOpened: {
root.store.resetStoreValues()

View File

@ -225,8 +225,8 @@ StatusListItem {
property string name
property bool favourite
anchors.centerIn: parent
header.title: qsTr("Are you sure?")
header.subTitle: name
headerSettings.title: qsTr("Are you sure?")
headerSettings.subTitle: name
contentItem: StatusBaseText {
anchors.centerIn: parent
height: contentHeight + topPadding + bottomPadding

View File

@ -16,7 +16,7 @@ StatusModal {
id: cryptoServicesPopupRoot
height: 400
header.title: qsTr("Buy crypto")
headerSettings.title: qsTr("Buy crypto")
anchors.centerIn: parent
Loader {

View File

@ -33,7 +33,7 @@ StatusModal {
property string completeAddressWithNetworkPrefix
}
header.title: qsTr("Receive")
headerSettings.title: qsTr("Receive")
contentHeight: layout.implicitHeight
width: 556

View File

@ -71,11 +71,11 @@ Item {
}
function onDisplayKeycardSharedModuleFlow() {
keycardPopup.active = true
Global.openPopup(keycardPopup);
}
function onDestroyKeycardSharedModuleFlow() {
keycardPopup.active = false
Global.closePopup();
}
function onMailserverWorking() {
@ -1365,17 +1365,12 @@ Item {
Global.settingsLoaded()
}
Loader {
Component {
id: keycardPopup
active: false
sourceComponent: KeycardPopup {
KeycardPopup {
anchors.centerIn: parent
sharedKeycardModule: appMain.rootStore.mainModuleInst.keycardSharedModule
}
onLoaded: {
keycardPopup.item.open()
}
}
DropAreaPanel {

View File

@ -41,24 +41,25 @@ QtObject {
Global.importCommunityPopupRequested.connect(openImportCommunityPopup)
Global.removeContactRequested.connect(openRemoveContactConfirmationPopup)
Global.openPopupRequested.connect(openPopup)
Global.closePopupRequested.connect(closePopup)
Global.openDeleteMessagePopup.connect(openDeleteMessagePopup)
Global.openDownloadImageDialog.connect(openDownloadImageDialog)
}
property var currentPopup
function openPopup(popupComponent, params = {}, cb = null) {
if (activePopupComponents.includes(popupComponent)) {
return
}
const popup = popupComponent.createObject(popupParent, params)
popup.open()
root.currentPopup = popupComponent.createObject(popupParent, params)
root.currentPopup.open();
if (cb)
cb(popup)
cb(root.currentPopup)
activePopupComponents.push(popupComponent)
popup.closed.connect(() => {
root.currentPopup.closed.connect(() => {
const removeIndex = activePopupComponents.indexOf(popupComponent)
if (removeIndex !== -1) {
activePopupComponents.splice(removeIndex, 1)
@ -66,6 +67,11 @@ QtObject {
})
}
function closePopup() {
if (!!root.currentPopup)
root.currentPopup.close();
}
function openChooseBrowserPopup(link: string) {
openPopup(chooseBrowserPopupComponent, {link: link})
}
@ -90,7 +96,7 @@ QtObject {
}
function openNicknamePopup(publicKey: string, nickname: string, subtitle: string) {
openPopup(nicknamePopupComponent, {publicKey: publicKey, nickname: nickname, "header.subTitle": subtitle})
openPopup(nicknamePopupComponent, {publicKey: publicKey, nickname: nickname, "headerSettings.subTitle": subtitle})
}
function openBlockContactPopup(publicKey: string, contactName: string) {
@ -125,7 +131,7 @@ QtObject {
userDisplayName: contactDetails.displayName,
userIcon: contactDetails.largeImage,
userIsEnsVerified: contactDetails.ensVerified,
"header.title": qsTr("Verify %1's Identity").arg(contactDetails.displayName),
"headerSettings.title": qsTr("Verify %1's Identity").arg(contactDetails.displayName),
challengeText: qsTr("Ask a question that only the real %1 will be able to answer e.g. a question about a shared experience, or ask %1 to enter a code or phrase you have sent to them via a different communication channel (phone, post, etc...).").arg(contactDetails.displayName),
buttonText: qsTr("Send verification request")
}, cb)
@ -229,7 +235,7 @@ QtObject {
ConfirmationDialog {
property string displayName
property string publicKey
header.title: qsTr("Remove '%1' as a contact").arg(displayName)
headerSettings.title: qsTr("Remove '%1' as a contact").arg(displayName)
confirmationText: qsTr("This will mean that you and '%1' will no longer be able to send direct messages to each other. You will need to send them a new Contact Request in order to message again. All previous direct messages between you and '%1' will be retained in read-only mode.").arg(displayName)
showCancelButton: true
cancelBtnType: ""

View File

@ -22,10 +22,10 @@ Popup {
property var store
onOpened: {
Global.popupOpened = true
Global.activityPopupOpened = true
}
onClosed: {
Global.popupOpened = false
Global.activityPopupOpened = false
Qt.callLater(activityCenterStore.markAsSeenActivityCenterNotifications)
}

View File

@ -8,13 +8,13 @@ import shared.stores 1.0
import StatusQ.Controls 0.1
Popup {
Dialog {
id: root
width: buttonRow.width
height: buttonRow.height
padding: 0
margins: 0
closePolicy: Popup.CloseOnReleaseOutsideParent | Popup.CloseOnEscape
closePolicy: Popup.CloseOnReleaseOutside | Popup.CloseOnEscape
signal sendTransactionCommandButtonClicked()
signal receiveTransactionCommandButtonClicked()

View File

@ -28,7 +28,7 @@ StatusModal {
property alias checkbox: checkbox
header.title: qsTr("Confirm your action")
headerSettings.title: qsTr("Confirm your action")
focus: visible
signal confirmButtonClicked()

View File

@ -6,7 +6,7 @@ ConfirmationDialog {
property var messageStore
property string messageId
header.title: qsTr("Confirm deleting this message")
headerSettings.title: qsTr("Confirm deleting this message")
confirmationText: qsTr("Are you sure you want to delete this message? Be aware that other clients are not guaranteed to delete the message as well.")
height: 260
checkbox.visible: true

View File

@ -19,7 +19,7 @@ StatusModal {
width: 420
height: 250
closePolicy: Popup.NoAutoClose
header.title: qsTr("Edit")
headerSettings.title: qsTr("Edit")
contentItem: Item {
StatusInput {
id: displayNameInput

View File

@ -50,12 +50,12 @@ Item {
StatusModal {
id: imageCropperModal
header.title: root.title
headerSettings.title: root.title
anchors.centerIn: Overlay.overlay
width: root.roundedImage ? 480 : 580
destroyOnClose: false
StatusImageCropPanel {
id: imageCropper
objectName: "profileImageCropper"

View File

@ -10,7 +10,7 @@ StatusModal {
property var rootStore
header.title: qsTr("Download Status link")
headerSettings.title: qsTr("Download Status link")
height: 156
StatusDescriptionListItem {

View File

@ -14,6 +14,7 @@ Popup {
default property alias content: popupContent.children
property alias contentWrapper: popupContent
property alias header: headerContent.children
property bool destroyOnClose: true
id: popup
modal: true
@ -33,11 +34,9 @@ Popup {
color: Style.current.background
radius: 8
}
onOpened: {
Global.popupOpened = true
}
onClosed: {
Global.popupOpened = false
if (popup.destroyOnClose)
popup.destroy();
}
padding: 0
contentItem: Item {
@ -165,5 +164,5 @@ Popup {
anchors.rightMargin: visible ? Style.current.padding : 0
anchors.leftMargin: visible ? Style.current.padding : 0
}
}
}
}

View File

@ -17,8 +17,8 @@ StatusModal {
height: 340
anchors.centerIn: parent
header.title: qsTr("Nickname")
header.subTitleElide: Text.ElideMiddle
headerSettings.title: qsTr("Nickname")
headerSettings.subTitleElide: Text.ElideMiddle
/*required*/ property string publicKey
property string nickname

View File

@ -20,7 +20,7 @@ StatusModal {
signal removeAccount(string address)
header.title: qsTr("Remove %1").arg(root.accountName)
headerSettings.title: qsTr("Remove %1").arg(root.accountName)
focus: visible
padding: Style.current.padding

View File

@ -11,7 +11,7 @@ import StatusQ.Controls 0.1
StatusModal {
id: root
header.title: qsTr("Select account")
headerSettings.title: qsTr("Select account")
height: 284
property var accounts

View File

@ -29,7 +29,7 @@ StatusModal {
width: 480
height: 548
header.title: d.loadingContactDetails ? qsTr("Send Contact Request")
headerSettings.title: d.loadingContactDetails ? qsTr("Send Contact Request")
: qsTr("Send Contact Request to %1").arg(d.userDisplayName)
onAboutToShow: {

View File

@ -16,7 +16,7 @@ import AppLayouts.Wallet 1.0
StatusModal {
id: root
header.title: qsTr("Send")
headerSettings.title: qsTr("Send")
height: 540
property var store
@ -88,7 +88,7 @@ StatusModal {
// initialItem: groupPreview
// isLastGroup: stack.currentGroup === groupSignTx
// onGroupActivated: {
// root.header.title = group.headerText
// root.headerSettings.title = group.headerText
// btnNext.text = group.footerText
// }
// TransactionFormGroup {

View File

@ -53,6 +53,7 @@ Popup {
dissapearInMs = 4000
displayCloseButton = true
displayLink = true
root.destroy();
}
Timer {

View File

@ -14,8 +14,9 @@ StatusModal {
closePolicy: d.disableActionPopupButtons || d.disableCloseButton? Popup.NoAutoClose : Popup.CloseOnEscape | Popup.CloseOnPressOutside
hasCloseButton: !d.disableActionPopupButtons && !d.disableCloseButton
destroyOnClose: false
header.title: {
headerSettings.title: {
switch (root.sharedKeycardModule.currentState.flowType) {
case Constants.keycardSharedFlow.setupNewKeycard:
return qsTr("Set up a new Keycard with an existing account")
@ -51,10 +52,13 @@ StatusModal {
KeycardPopupDetails {
id: d
sharedKeycardModule: root.sharedKeycardModule
onCancelBtnClicked: {
root.close();
}
}
onClosed: {
root.sharedKeycardModule.currentState.doCancelAction()
root.sharedKeycardModule.currentState.doCancelAction();
}
StatusScrollView {

View File

@ -12,6 +12,8 @@ QtObject {
property bool primaryButtonEnabled: false
signal cancelBtnClicked()
// disables action buttons (back, cancel, primary, secondary) and close button (upper right "X" button) as well
readonly property bool disableActionPopupButtons: {
if (root.sharedKeycardModule.disablePopup) {
@ -369,9 +371,8 @@ QtObject {
return false
}
enabled: !root.disableActionPopupButtons
onClicked: {
root.sharedKeycardModule.currentState.doCancelAction()
root.cancelBtnClicked();
}
},

View File

@ -88,7 +88,7 @@ Item {
ConfirmationDialog {
id: confirmationPopup
header.title: qsTr("Remove account")
headerSettings.title: qsTr("Remove account")
confirmationText: d.accountNameToBeRemoved.length > 0?
qsTr("Do you want to delete the %1 account?").arg(d.accountNameToBeRemoved)
: qsTr("Do you want to delete the last account?")

View File

@ -120,7 +120,6 @@ Rectangle {
QtObject {
id: d
readonly property string emojiReplacementSymbols: ":='xX><0O;*dB8-D#%\\"
//mentions helper properties
@ -161,6 +160,8 @@ Rectangle {
}
}
property bool chatCommandsPopupOpen: false
function copyMentions(start, end) {
copiedMentionsPos = []
for (let k = 0; k < mentionsPos.length; k++) {
@ -1025,27 +1026,30 @@ Rectangle {
}
}
// TODO remove that Loader when the Chat Commands are re-implemented and fixed
// Bonus if we use `openPopup` instead with a Component instead
Loader {
active: false
sourceComponent: ChatCommandsPopup {
id: chatCommandsPopup
x: 8
y: -height
Component {
id: chatCommandsPopup
ChatCommandsPopup {
x: (parent.width - control.width - Style.current.halfPadding)
y: 716
onSendTransactionCommandButtonClicked: {
control.sendTransactionCommandButtonClicked()
chatCommandsPopup.close()
control.sendTransactionCommandButtonClicked();
chatCommandsPopup.close();
}
onReceiveTransactionCommandButtonClicked: {
control.receiveTransactionCommandButtonClicked()
chatCommandsPopup.close()
control.receiveTransactionCommandButtonClicked();
chatCommandsPopup.close();
}
onClosed: {
chatCommandsBtn.highlighted = false
chatCommandsBtnLoader.highlighted = false;
destroy();
}
Component.onDestruction: {
if (d.chatCommandsPopupOpen)
d.chatCommandsPopupOpen = false;
}
onOpened: {
chatCommandsBtn.highlighted = true
chatCommandsBtnLoader.highlighted = true;
}
}
}
@ -1077,6 +1081,7 @@ Rectangle {
// TODO remove that Loader when the Chat Commands are re-implemented and fixed
Loader {
id: chatCommandsBtnLoader
active: false
sourceComponent: StatusQ.StatusFlatRoundButton {
id: chatCommandsBtn
@ -1089,9 +1094,8 @@ Rectangle {
visible: RootStore.isWalletEnabled && !isEdit && control.chatType === Constants.chatType.oneToOne
enabled: !control.isContactBlocked
onClicked: {
chatCommandsPopup.opened ?
chatCommandsPopup.close() :
chatCommandsPopup.open()
d.chatCommandsPopupOpen ? Global.closePopup() : Global.openPopup(chatCommandsPopup);
d.chatCommandsPopupOpen = !d.chatCommandsPopupOpen;
}
}
}

View File

@ -85,4 +85,8 @@ Popup {
root.close()
}
}
onClosed: {
root.destroy();
}
}

View File

@ -159,4 +159,8 @@ Popup {
searchBox.text = ""
searchBox.input.edit.forceActiveFocus()
}
onClosed: {
root.destroy();
}
}

View File

@ -39,7 +39,7 @@ Item {
SortFilterProxyModel {
id: filteredModel
sourceModel: assets
sourceModel: !!assets ? assets : null
filters: [
ExpressionFilter {
expression: visibleForNetworkWithPositiveBalance || loading
@ -67,13 +67,13 @@ Item {
Component {
id: tokenDelegate
TokenDelegate {
objectName: "AssetView_TokenListItem_" + (modelData ? modelData.symbol : "")
readonly property string balance: modelData ? "%1".arg(modelData.enabledNetworkBalance.amount) : "" // Needed for the tests
errorTooltipText_1: modelData ? networkConnectionStore.getBlockchainNetworkDownTextForToken(modelData.balances) : ""
errorTooltipText_2: networkConnectionStore.getMarketNetworkDownText()
subTitle: !modelData || networkConnectionStore.noTokenBalanceAvailable ? "" : LocaleUtils.currencyAmountToLocaleString(modelData.enabledNetworkBalance)
errorMode: networkConnectionStore.noBlockchainConnectionAndNoCache && !networkConnectionStore.noMarketConnectionAndNoCache
errorIcon.tooltip.text: networkConnectionStore.noBlockchainConnectionAndNoCacheText
objectName: "AssetView_TokenListItem_" + (!!modelData ? modelData.symbol : "")
readonly property string balance: !!modelData ? "%1".arg(modelData.enabledNetworkBalance.amount) : "" // Needed for the tests
errorTooltipText_1: !!modelData && !! networkConnectionStore ? networkConnectionStore.getBlockchainNetworkDownTextForToken(modelData.balances) : ""
errorTooltipText_2: !!networkConnectionStore ? networkConnectionStore.getMarketNetworkDownText() : ""
subTitle: !modelData || (!!networkConnectionStore && !networkConnectionStore.noTokenBalanceAvailable) ? "" : LocaleUtils.currencyAmountToLocaleString(modelData.enabledNetworkBalance)
errorMode: !!networkConnectionStore ? networkConnectionStore.noBlockchainConnectionAndNoCache && !networkConnectionStore.noMarketConnectionAndNoCache : false
errorIcon.tooltip.text: !!networkConnectionStore ? networkConnectionStore.noBlockchainConnectionAndNoCacheText : ""
onClicked: {
RootStore.getHistoricalDataForToken(modelData.symbol, RootStore.currencyStore.currentCurrency)
d.selectedAssetIndex = index

View File

@ -34,10 +34,13 @@ Item {
anchors.horizontalCenter: parent.horizontalCenter
anchors.top: noContacts.bottom
anchors.topMargin: Style.current.padding
onClicked: inviteFriendsPopup.open()
onClicked: Global.openPopup(inviteFriendsPopup);
}
InviteFriendsPopup {
Component {
id: inviteFriendsPopup
rootStore: noContactsRect.rootStore
InviteFriendsPopup {
rootStore: noContactsRect.rootStore
}
}
}

View File

@ -257,7 +257,7 @@ Pane {
ConfirmationDialog {
id: removeVerificationConfirmationDialog
header.title: qsTr("Remove contact verification")
headerSettings.title: qsTr("Remove contact verification")
confirmationText: qsTr("This will remove the contact's verified status. Please confirm.")
onConfirmButtonClicked: {
root.contactsStore.removeTrustStatus(root.publicKey)

View File

@ -46,7 +46,7 @@ Item {
cursorShape: Qt.PointingHandCursor
onClicked: {
if (root.state === Constants.addressRequested) {
selectAccountModal.open()
Global.openPopup(selectAccountModalComponent);
} else if (root.state === Constants.transactionRequested) {
Global.openPopup(signTxComponent)
}
@ -117,14 +117,17 @@ Item {
}
}
SelectAccountModal {
id: selectAccountModal
anchors.centerIn: parent
accounts: root.store.accounts
currency: root.store.currentCurrency
onSelectAndShareAddressButtonClicked: {
root.store.acceptAddressRequest(messageId, accountSelector.selectedAccount.address)
selectAccountModal.close()
Component {
id: selectAccountModalComponent
SelectAccountModal {
id: selectAccountModal
anchors.centerIn: parent
accounts: root.store.accounts
currency: root.store.currentCurrency
onSelectAndShareAddressButtonClicked: {
root.store.acceptAddressRequest(messageId, accountSelector.selectedAccount.address)
selectAccountModal.close()
}
}
}
}

View File

@ -486,7 +486,7 @@ Loader {
disableHover: root.disableHover ||
delegate.hideQuickActions ||
(root.chatLogView && root.chatLogView.moving) ||
Global.popupOpened
Global.activityPopupOpened
disableEmojis: root.isChatBlocked
hideMessage: d.hideMessage

View File

@ -7,7 +7,7 @@ QtObject {
property var dragArea
property var applicationWindow
property bool popupOpened: false
property bool activityPopupOpened: false
property int settingsSubsection: Constants.settingsSubsection.profile
property var userProfile
@ -28,6 +28,7 @@ QtObject {
signal displayToastMessage(string title, string subTitle, string icon, bool loading, int ephNotifType, string url)
signal openPopupRequested(var popupComponent, var params)
signal closePopupRequested()
signal openNicknamePopupRequested(string publicKey, string nickname, string subtitle)
signal openDownloadModalRequested(bool available, string version, string url)
signal openChangeProfilePicPopup(var cb)
@ -72,6 +73,10 @@ QtObject {
root.openPopupRequested(popupComponent, params);
}
function closePopup() {
root.closePopupRequested();
}
function openDownloadModal(available, version, url){
root.openDownloadModalRequested(available, version, url);
}