Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ConnectDAppModal): don't overflow texts #15889

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions storybook/qmlTests/tests/tst_ConnectDAppModal.qml
Original file line number Diff line number Diff line change
Expand Up @@ -180,14 +180,14 @@ Item {
verify(chainSelector, "Chain selector should be present")
compare(chainSelector.selection.length, NetworksModel.flatNetworks.count)

// User should not be able to deselect a chain
// User should not be able to open the popup
mouseClick(chainSelector)
waitForItemPolished(chainSelector)
const networkSelectorList = findChild(chainSelector, "networkSelectorList")
verify(networkSelectorList, "Network selector list should be present")
mouseClick(networkSelectorList.itemAtIndex(0))
compare(chainSelector.selection.length, NetworksModel.flatNetworks.count)
compare(dappModal.selectedChains.length, NetworksModel.flatNetworks.count)
verify(!chainSelector.control.popup.opened)

const connectionTag = findChild(dappModal, "connectionStatusTag")
compare(connectionTag.visible, true)
Expand Down Expand Up @@ -236,14 +236,14 @@ Item {
verify(chainSelector, "Chain selector should be present")
compare(chainSelector.selection.length, NetworksModel.flatNetworks.count)

// User should not be able to deselect a chain
// User should not be able to open the popup
mouseClick(chainSelector)
waitForItemPolished(chainSelector)
const networkSelectorList = findChild(chainSelector, "networkSelectorList")
verify(networkSelectorList, "Network selector list should be present")
mouseClick(networkSelectorList.itemAtIndex(0))
compare(chainSelector.selection.length, NetworksModel.flatNetworks.count)
compare(dappModal.selectedChains.length, NetworksModel.flatNetworks.count)
verify(!chainSelector.control.popup.opened)

const connectionTag = findChild(dappModal, "connectionStatusTag")
compare(connectionTag.visible, true)
Expand Down
2 changes: 1 addition & 1 deletion ui/app/AppLayouts/Wallet/controls/NetworkFilter.qml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ StatusComboBox {
control.indicator: SQP.StatusComboboxIndicator {
x: root.control.mirrored ? root.control.horizontalPadding : root.width - width - root.control.horizontalPadding
y: root.control.topPadding + (root.control.availableHeight - height) / 2
visible: !d.selectionUnavailable
visible: !d.selectionUnavailable && root.selectionAllowed
}

control.contentItem: RowLayout {
Expand Down
8 changes: 5 additions & 3 deletions ui/imports/shared/popups/walletconnect/ConnectDAppModal.qml
Original file line number Diff line number Diff line change
Expand Up @@ -113,16 +113,18 @@ StatusDialog {

DAppCard {
id: dappCard
Layout.maximumWidth: root.availableWidth - Layout.leftMargin * 2
Layout.maximumWidth: scrollView.availableWidth - Layout.leftMargin * 2
Layout.leftMargin: 12
Layout.rightMargin: Layout.leftMargin
Layout.topMargin: 14
Layout.bottomMargin: Layout.topMargin
connectionSuccessful: d.connectionSuccessful
connectionAttempted: d.connectionAttempted
}

ContextCard {
id: contextCard
Layout.maximumWidth: root.availableWidth
Layout.maximumWidth: scrollView.availableWidth
Layout.fillWidth: true

multipleChainSelection: root.multipleChainSelection
Expand All @@ -140,7 +142,7 @@ StatusDialog {
}

PermissionsCard {
Layout.maximumWidth: root.availableWidth
Layout.maximumWidth: scrollView.availableWidth
Layout.fillWidth: true

Layout.leftMargin: 16
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import QtQuick 2.15
import QtQuick.Controls 2.15
import QtQuick.Layouts 1.15

import StatusQ 0.1
Expand Down Expand Up @@ -83,7 +84,14 @@ Rectangle {
multiSelection: root.multipleChainSelection
showAllSelectedText: false
selectionAllowed: false

// disable interactions w/o looking disabled
control.hoverEnabled: false
MouseArea {
anchors.fill: parent
onPressed: mouse.accepted = true
}
}
}
}
}
}
9 changes: 6 additions & 3 deletions ui/imports/shared/popups/walletconnect/private/DAppCard.qml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import QtQuick 2.15
import QtQuick.Controls 2.15
import QtQuick.Layouts 1.15

import StatusQ 0.1
Expand All @@ -15,6 +16,8 @@ ColumnLayout {
property alias name: appNameText.text
property url dAppUrl: ""
property url iconUrl: ""
property bool connectionSuccessful
property bool connectionAttempted

spacing: Style.current.padding

Expand Down Expand Up @@ -67,8 +70,8 @@ ColumnLayout {
Layout.alignment: Qt.AlignHCenter
Layout.maximumWidth: root.width
objectName: "connectionStatusTag"
success: d.connectionSuccessful
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No d around here

visible: d.connectionAttempted
success: root.connectionSuccessful
visible: root.connectionAttempted
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,28 @@ ColumnLayout {
property string dappName: ""

StatusBaseText {
Layout.fillWidth: true
objectName: "permissionsTitle"
text: qsTr("%1 will be able to:").arg(root.dappName)
Layout.preferredHeight: 18
font.pixelSize: 13
elide: Text.ElideMiddle
color: Theme.palette.baseColor1
}

StatusBaseText {
text: qsTr("Check your account balance and activity")
Layout.fillWidth: true
Layout.preferredHeight: 18

elide: Text.ElideRight
font.pixelSize: 13
}

StatusBaseText {
text: qsTr("Request transactions and message signing")
Layout.fillWidth: true
Layout.preferredHeight: 18

elide: Text.ElideRight
font.pixelSize: 13
}
}
}