mirror of
https://github.com/status-im/status-desktop.git
synced 2025-02-09 13:16:45 +00:00
feat(wallet): Update send modal height handling (#17143)
This commit is contained in:
parent
ea33f151db
commit
3b56fc0895
@ -33,8 +33,11 @@ Rectangle {
|
|||||||
/** Search pattern in recipient view input **/
|
/** Search pattern in recipient view input **/
|
||||||
readonly property string searchPattern: recipientInputLoader.searchPattern
|
readonly property string searchPattern: recipientInputLoader.searchPattern
|
||||||
|
|
||||||
|
/** Currently viewed tab is empty **/
|
||||||
|
readonly property bool emptyListVisible: emptyListText.visible && !selectedRecipientAddress
|
||||||
|
|
||||||
/** Currently selected recipient tab **/
|
/** Currently selected recipient tab **/
|
||||||
readonly property int selectedRecipientType: Constants.RecipientAddressObjectType.RecentsAddress
|
readonly property alias selectedRecipientType: d.selectedRecipientType
|
||||||
/** Selected recipient address. It is input and output property **/
|
/** Selected recipient address. It is input and output property **/
|
||||||
property alias selectedRecipientAddress: recipientInputLoader.selectedRecipientAddress
|
property alias selectedRecipientAddress: recipientInputLoader.selectedRecipientAddress
|
||||||
|
|
||||||
@ -62,6 +65,7 @@ Rectangle {
|
|||||||
|
|
||||||
readonly property bool searchInProgress: !!root.searchPattern && root.recipientsFilterModel.ModelCount.count > 0
|
readonly property bool searchInProgress: !!root.searchPattern && root.recipientsFilterModel.ModelCount.count > 0
|
||||||
property int highlightedIndex: 0
|
property int highlightedIndex: 0
|
||||||
|
property int selectedRecipientType: Constants.RecipientAddressObjectType.RecentsAddress
|
||||||
|
|
||||||
function handleKeyPressOnSearch(event) {
|
function handleKeyPressOnSearch(event) {
|
||||||
if (!event || !d.searchInProgress || highlightedIndex === -1)
|
if (!event || !d.searchInProgress || highlightedIndex === -1)
|
||||||
@ -144,19 +148,19 @@ Rectangle {
|
|||||||
width: implicitWidth
|
width: implicitWidth
|
||||||
objectName: "recentAddressesTab"
|
objectName: "recentAddressesTab"
|
||||||
text: qsTr("Recent")
|
text: qsTr("Recent")
|
||||||
onClicked: root.selectedRecipientType = Constants.RecipientAddressObjectType.RecentsAddress
|
onClicked: d.selectedRecipientType = Constants.RecipientAddressObjectType.RecentsAddress
|
||||||
}
|
}
|
||||||
StatusTabButton {
|
StatusTabButton {
|
||||||
width: implicitWidth
|
width: implicitWidth
|
||||||
objectName: "savedAddressesTab"
|
objectName: "savedAddressesTab"
|
||||||
text: qsTr("Saved")
|
text: qsTr("Saved")
|
||||||
onClicked: root.selectedRecipientType = Constants.RecipientAddressObjectType.SavedAddress
|
onClicked: d.selectedRecipientType = Constants.RecipientAddressObjectType.SavedAddress
|
||||||
}
|
}
|
||||||
StatusTabButton {
|
StatusTabButton {
|
||||||
width: implicitWidth
|
width: implicitWidth
|
||||||
objectName: "myAccountsTab"
|
objectName: "myAccountsTab"
|
||||||
text: qsTr("My Accounts")
|
text: qsTr("My Accounts")
|
||||||
onClicked: root.selectedRecipientType = Constants.RecipientAddressObjectType.Account
|
onClicked: d.selectedRecipientType = Constants.RecipientAddressObjectType.Account
|
||||||
}
|
}
|
||||||
|
|
||||||
visible: !root.selectedRecipientAddress && !d.searchInProgress
|
visible: !root.selectedRecipientAddress && !d.searchInProgress
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import QtQuick 2.15
|
import QtQuick 2.15
|
||||||
|
import QtQuick.Window 2.15
|
||||||
import QtQuick.Layouts 1.15
|
import QtQuick.Layouts 1.15
|
||||||
import QtQml.Models 2.15
|
import QtQml.Models 2.15
|
||||||
|
|
||||||
@ -335,10 +336,32 @@ StatusDialog {
|
|||||||
}
|
}
|
||||||
|
|
||||||
width: 556
|
width: 556
|
||||||
|
height: {
|
||||||
|
if (!selectedRecipientAddress)
|
||||||
|
return root.contentItem.Window.height - topMargin - margins
|
||||||
|
let contentHeight = Math.max(sendModalHeader.height +
|
||||||
|
amountToSend.height +
|
||||||
|
recipientsPanelLayout.height +
|
||||||
|
feesLayout.height +
|
||||||
|
scrollViewLayout.spacing*3 +
|
||||||
|
28,
|
||||||
|
scrollView.implicitHeight) + footer.height
|
||||||
|
|
||||||
|
if (!!footer.errorTags && !feesLayout.visible) {
|
||||||
|
// Utilize empty space when fees are not visible and error is shown
|
||||||
|
contentHeight -= feesLayout.height
|
||||||
|
}
|
||||||
|
return contentHeight
|
||||||
|
}
|
||||||
padding: 0
|
padding: 0
|
||||||
horizontalPadding: Theme.xlPadding
|
horizontalPadding: Theme.xlPadding
|
||||||
topMargin: margins + accountSelector.height + Theme.padding
|
topMargin: margins + accountSelector.height + Theme.padding
|
||||||
|
|
||||||
|
Behavior on height {
|
||||||
|
enabled: !!root.selectedRecipientAddress
|
||||||
|
NumberAnimation { duration: 100; easing: Easing.OutCurve }
|
||||||
|
}
|
||||||
|
|
||||||
background: StatusDialogBackground {
|
background: StatusDialogBackground {
|
||||||
color: Theme.palette.baseColor3
|
color: Theme.palette.baseColor3
|
||||||
}
|
}
|
||||||
@ -353,13 +376,6 @@ StatusDialog {
|
|||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
|
|
||||||
implicitWidth: parent.width
|
implicitWidth: parent.width
|
||||||
implicitHeight: Math.max(sendModalHeader.height +
|
|
||||||
amountToSend.height +
|
|
||||||
recipientsPanelLayout.height +
|
|
||||||
feesLayout.height +
|
|
||||||
scrollViewLayout.spacing*3 +
|
|
||||||
28,
|
|
||||||
scrollView.implicitHeight)
|
|
||||||
|
|
||||||
// Floating account Selector
|
// Floating account Selector
|
||||||
AccountSelectorHeader {
|
AccountSelectorHeader {
|
||||||
@ -523,19 +539,41 @@ StatusDialog {
|
|||||||
id: recipientsPanelLayout
|
id: recipientsPanelLayout
|
||||||
|
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
|
Layout.fillHeight: true
|
||||||
|
|
||||||
spacing: Theme.halfPadding
|
spacing: Theme.halfPadding
|
||||||
|
|
||||||
StatusBaseText {
|
StatusBaseText {
|
||||||
elide: Text.ElideRight
|
elide: Text.ElideRight
|
||||||
text: qsTr("To")
|
text: qsTr("To")
|
||||||
|
Layout.alignment: Qt.AlignTop
|
||||||
}
|
}
|
||||||
RecipientSelectorPanel {
|
Item {
|
||||||
id: recipientsPanel
|
Layout.alignment: Qt.AlignTop
|
||||||
|
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.fillHeight: true
|
|
||||||
Layout.bottomMargin: feesLayout.visible ? 0 : Theme.xlPadding
|
Layout.bottomMargin: feesLayout.visible ? 0 : Theme.xlPadding
|
||||||
|
implicitHeight: recipientsPanel.height
|
||||||
|
|
||||||
|
Rectangle {
|
||||||
|
anchors {
|
||||||
|
top: recipientsPanel.top
|
||||||
|
left: recipientsPanel.left
|
||||||
|
right: recipientsPanel.right
|
||||||
|
}
|
||||||
|
// Imitate recipient background and overflow the rectangle under footer
|
||||||
|
height: recipientsPanel.emptyListVisible ? sendModalcontentItem.height : 0
|
||||||
|
color: recipientsPanel.color
|
||||||
|
radius: recipientsPanel.radius
|
||||||
|
}
|
||||||
|
|
||||||
|
RecipientSelectorPanel {
|
||||||
|
id: recipientsPanel
|
||||||
|
anchors {
|
||||||
|
top: parent.top
|
||||||
|
left: parent.left
|
||||||
|
right: parent.right
|
||||||
|
}
|
||||||
|
|
||||||
interactive: root.interactive
|
interactive: root.interactive
|
||||||
|
|
||||||
@ -545,6 +583,7 @@ StatusDialog {
|
|||||||
onResolveENS: root.fnResolveENS(ensName, uuid)
|
onResolveENS: root.fnResolveENS(ensName, uuid)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Fees Component
|
// Fees Component
|
||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user