What changed, and why it matters
This is a user-interface performance patch for the Monero wallet app. It rewrites how the Account and Receive pages display long lists of subaddresses, replacing a layout that loaded every item at once with a scrollable list that reuses items. There is no clear security bug being fixed; it appears aimed at making the app faster and smoother when many addresses exist.
Treat as a routine UI performance/bugfix merge. No security response required. If reviewing, verify that the new ListView scrolling and focus behavior do not introduce UI state inconsistencies, but the diff shows no exploitable vulnerability.
Security signals we found
No direct security signal in diff: no cryptographic, network, or wallet-seed handling changes
One defensive guard added: bounds check on subaddressListView.currentIndex before accessing wallet subaddress data
One variable rename fixes a typo but has no security effect
No input validation, serialization, or privilege changes observed
Evidence from the diff
The commit refactors MiddlePanel.qml, pages/Account.qml, and pages/Receive.qml. It switches the Account and Receive pages from a static ColumnLayout containing a non-interactive ListView to a full-height ListView with an inline header, reusable delegates, vertical scrollbar, and bounds behavior. It also fixes a typo (selectedAddressDrescription -> selectedAddressDescription), guards updateSelectedAddressDisplay against invalid wallet/currentIndex, and moves clearFields()/generateQRCodeString() into the header item. The changes are UI/UX and performance-oriented.
Changed components
monero-gui MiddlePanel.qmlmonero-gui pages/Account.qmlmonero-gui pages/Receive.qmlInspect captured patch +235 / −141
### MiddlePanel.qml
@@ -137,7 +137,7 @@ Rectangle {
}, State {
name: "Receive"
PropertyChanges { target: root; currentView: receiveView }
- PropertyChanges { target: mainFlickable; contentHeight: receiveView.receiveHeight + 80 }
+ PropertyChanges { target: mainFlickable; contentHeight: mainFlickable.height; interactive: false }
}, State {
name: "Merchant"
PropertyChanges { target: root; currentView: merchantView }
@@ -161,7 +161,7 @@ Rectangle {
}, State {
name: "Account"
PropertyChanges { target: root; currentView: accountView }
- PropertyChanges { target: mainFlickable; contentHeight: accountView.accountHeight + 80 }
+ PropertyChanges { target: mainFlickable; contentHeight: mainFlickable.height; interactive: false }
}
]
@@ -186,6 +186,7 @@ Rectangle {
boundsBehavior: isMac ? Flickable.DragAndOvershootBounds : Flickable.StopAtBounds
ScrollBar.vertical: ScrollBar {
+ visible: root.currentView !== root.receiveView && root.currentView !== root.accountView
parent: root
anchors.left: parent.right
anchors.leftMargin: -14 // 10 margin + 4 scrollbar width
### pages/Account.qml
@@ -26,6 +26,8 @@
// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+pragma ComponentBehavior: Bound
+
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
@@ -47,9 +49,8 @@ Rectangle {
id: pageAccount
color: "transparent"
property var model
- property alias accountHeight: mainLayout.height
- property alias balanceAllText: balanceAll.text
- property alias unlockedBalanceAllText: unlockedBalanceAll.text
+ property string balanceAllText
+ property string unlockedBalanceAllText
property bool selectAndSend: false
property int currentAccountIndex
@@ -65,17 +66,52 @@ Rectangle {
Clipboard { id: clipboard }
- /* main layout */
- ColumnLayout {
- id: mainLayout
+ ListView {
+ id: subaddressAccountListView
anchors.margins: 20
anchors.topMargin: 40
+ anchors.fill: parent
+ clip: true
+ boundsBehavior: ListView.StopAtBounds
+ reuseItems: true
+ cacheBuffer: 100
+ currentIndex: currentAccountIndex
+ headerPositioning: ListView.InlineHeader
+ // Selecting a partially visible row must not scroll it or the inline header.
+ highlightFollowsCurrentItem: false
+
+ // Keep the top visible when the inline header changes height.
+ // TODO: Once Qt 6.12 is the minimum version, use a conditional Binding
+ // of contentY to originY while atYBeginning instead.
+ property real previousOriginY: 0
+ onOriginYChanged: {
+ if (contentY <= previousOriginY)
+ contentY = originY;
+ previousOriginY = originY;
+ }
- anchors.left: parent.left
- anchors.top: parent.top
- anchors.right: parent.right
+ onFlickingChanged: releaseFocus()
+
+ ScrollBar.vertical: ScrollBar {
+ id: subaddressAccountScrollBar
+ policy: ScrollBar.AsNeeded
+ parent: pageAccount
+ anchors.top: parent.top
+ anchors.topMargin: 40
+ anchors.right: parent.right
+ anchors.rightMargin: 6
+ anchors.bottom: parent.bottom
+ anchors.bottomMargin: 20
+ active: !isMac || subaddressAccountListView.moving || hovered || pressed
+ z: 2
+ palette.mid: "#8E8E93"
+ palette.dark: "#B8B8BD"
+ }
- spacing: 20
+ header: ColumnLayout {
+ id: mainLayout
+ width: subaddressAccountListView.width
+ spacing: 20
ColumnLayout {
id: balanceRow
@@ -103,6 +139,7 @@ Rectangle {
MoneroComponents.TextPlain {
id: balanceAll
+ text: pageAccount.balanceAllText
Layout.rightMargin: 87
font.family: MoneroComponents.Style.fontMonoRegular.name;
font.pixelSize: 16
@@ -138,6 +175,7 @@ Rectangle {
MoneroComponents.TextPlain {
id: unlockedBalanceAll
+ text: pageAccount.unlockedBalanceAllText
Layout.rightMargin: 87
font.family: MoneroComponents.Style.fontMonoRegular.name;
font.pixelSize: 16
@@ -162,12 +200,13 @@ Rectangle {
ColumnLayout {
id: addressRow
+ Layout.fillWidth: true
spacing: 0
RowLayout {
spacing: 0
- MoneroComponents.LabelSubheader {
+ MoneroComponents.Label {
Layout.fillWidth: true
fontSize: 24
textFormat: Text.RichText
@@ -186,51 +225,40 @@ Rectangle {
appWindow.currentWallet.subaddressAccount.addRow(inputDialog.inputText)
appWindow.currentWallet.switchSubaddressAccount(appWindow.currentWallet.numSubaddressAccounts() - 1)
appWindow.onWalletUpdate();
+ subaddressAccountListView.positionViewAtIndex(currentAccountIndex, ListView.Contain)
}
inputDialog.onRejectedCallback = null;
inputDialog.open()
}
- Rectangle {
- anchors.top: createNewAccountButton.bottom
- anchors.topMargin: 8
- anchors.left: createNewAccountButton.left
- anchors.right: createNewAccountButton.right
- height: 2
- color: MoneroComponents.Style.appWindowBorderColor
-
- MoneroEffects.ColorTransition {
- targetObj: parent
- blackColor: MoneroComponents.Style._b_appWindowBorderColor
- whiteColor: MoneroComponents.Style._w_appWindowBorderColor
- }
- }
}
}
- ColumnLayout {
- id: subaddressAccountListRow
- property int subaddressAccountListItemHeight: 50
- Layout.topMargin: 6
+ Rectangle {
Layout.fillWidth: true
- Layout.minimumWidth: 240
- Layout.preferredHeight: subaddressAccountListItemHeight * subaddressAccountListView.count
- visible: subaddressAccountListView.count >= 1
+ Layout.topMargin: 8
+ Layout.preferredHeight: 2
+ color: MoneroComponents.Style.appWindowBorderColor
- ListView {
- id: subaddressAccountListView
- Layout.fillWidth: true
- Layout.fillHeight: true
- clip: true
- boundsBehavior: ListView.StopAtBounds
- interactive: false
- currentIndex: currentAccountIndex
+ MoneroEffects.ColorTransition {
+ targetObj: parent
+ blackColor: MoneroComponents.Style._b_appWindowBorderColor
+ whiteColor: MoneroComponents.Style._w_appWindowBorderColor
+ }
+ }
+
+ }
+
+ }
- delegate: Rectangle {
+ delegate: Rectangle {
id: tableItem2
- height: subaddressAccountListRow.subaddressAccountListItemHeight
- width: parent ? parent.width : undefined
- Layout.fillWidth: true
+ required property int index
+ required property string address
+ required property string balance
+ required property string label
+ height: 50
+ width: subaddressAccountListView.width
color: itemMouseArea.containsMouse || index === currentAccountIndex ? MoneroComponents.Style.titleBarButtonHoverColor : "transparent"
Rectangle {
@@ -295,7 +323,7 @@ Rectangle {
anchors.leftMargin: -addressLabel.width - 30
fontSize: 16
fontFamily: MoneroComponents.Style.fontMonoRegular.name;
- text: TxUtils.addressTruncatePretty(address, mainLayout.width < 740 ? 1 : (mainLayout.width < 900 ? 2 : 3))
+ text: TxUtils.addressTruncatePretty(address, subaddressAccountListView.width < 740 ? 1 : (subaddressAccountListView.width < 900 ? 2 : 3))
themeTransition: false
}
@@ -369,36 +397,47 @@ Rectangle {
}
}
- onCurrentIndexChanged: {
- appWindow.onWalletUpdate();
- }
- }
- }
+ onCurrentIndexChanged: {
+ appWindow.onWalletUpdate();
+ }
- Rectangle {
- color: MoneroComponents.Style.appWindowBorderColor
- Layout.fillWidth: true
- height: 1
+ footer: Rectangle {
+ width: subaddressAccountListView.width
+ height: 1
+ color: MoneroComponents.Style.appWindowBorderColor
- MoneroEffects.ColorTransition {
- targetObj: parent
- blackColor: MoneroComponents.Style._b_appWindowBorderColor
- whiteColor: MoneroComponents.Style._w_appWindowBorderColor
- }
+ MoneroEffects.ColorTransition {
+ targetObj: parent
+ blackColor: MoneroComponents.Style._b_appWindowBorderColor
+ whiteColor: MoneroComponents.Style._w_appWindowBorderColor
}
}
}
+ // Stop scrolling without consuming the first click on a row or control.
+ MouseArea {
+ anchors.fill: subaddressAccountListView
+ onPressed: (mouse) => {
+ subaddressAccountListView.cancelFlick();
+ mouse.accepted = false;
+ }
+ }
+
function onPageCompleted() {
console.log("account");
if (appWindow.currentWallet !== undefined) {
appWindow.currentWallet.subaddressAccount.refresh();
subaddressAccountListView.model = appWindow.currentWallet.subaddressAccountModel;
appWindow.currentWallet.subaddress.refresh(appWindow.currentWallet.currentSubaddressAccount)
- balanceAll.text = walletManager.displayAmount(appWindow.currentWallet.balanceAll()) + " XMR"
- unlockedBalanceAll.text = walletManager.displayAmount(appWindow.currentWallet.unlockedBalanceAll()) + " XMR"
+ balanceAllText = walletManager.displayAmount(appWindow.currentWallet.balanceAll()) + " XMR"
+ unlockedBalanceAllText = walletManager.displayAmount(appWindow.currentWallet.unlockedBalanceAll()) + " XMR"
}
+ resetScroll();
+ }
+
+ function resetScroll() {
+ subaddressAccountListView.positionViewAtBeginning();
}
function onPageClosed() {
### pages/Receive.qml
@@ -26,6 +26,8 @@
// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+pragma ComponentBehavior: Bound
+
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
@@ -50,8 +52,8 @@ Rectangle {
id: pageReceive
color: "transparent"
property var model
- property alias receiveHeight: mainLayout.height
property var state: "Address"
+ property string selectedAddressDescription: "(" + qsTr("no label") + ")" + translationManager.emptyString
function renameSubaddressLabel(_index){
inputDialog.labelText = qsTr("Set the label of the selected address:") + translationManager.emptyString;
@@ -63,46 +65,97 @@ Rectangle {
}
function updateSelectedAddressDisplay() {
+ if (!appWindow.currentWallet || subaddressListView.currentIndex < 0
+ || subaddressListView.currentIndex >= appWindow.currentWallet.numSubaddresses(appWindow.currentWallet.currentSubaddressAccount)) {
+ return;
+ }
+
appWindow.current_subaddress_table_index = subaddressListView.currentIndex;
appWindow.current_address = appWindow.currentWallet.address(
appWindow.currentWallet.currentSubaddressAccount,
subaddressListView.currentIndex
);
if (subaddressListView.currentIndex == 0) {
- selectedAddressDrescription.text = qsTr("Primary address") + translationManager.emptyString;
+ selectedAddressDescription = qsTr("Primary address") + translationManager.emptyString;
} else {
var selectedAddressLabel = appWindow.currentWallet.getSubaddressLabel(appWindow.currentWallet.currentSubaddressAccount, appWindow.current_subaddress_table_index);
if (selectedAddressLabel == "") {
- selectedAddressDrescription.text = "(" + qsTr("no label") + ")" + translationManager.emptyString
+ selectedAddressDescription = "(" + qsTr("no label") + ")" + translationManager.emptyString
} else {
- selectedAddressDrescription.text = selectedAddressLabel
+ selectedAddressDescription = selectedAddressLabel
}
}
}
function generateQRCodeString() {
- if (pageReceive.state == "PaymentRequest") {
- return walletManager.make_uri(appWindow.current_address,
- amountToReceiveXMR.text,
- txDescriptionInput.text, receiverNameInput.text);
- } else {
- return walletManager.make_uri(appWindow.current_address);
- }
+ return subaddressListView.headerItem
+ ? subaddressListView.headerItem.generateQRCodeString()
+ : walletManager.make_uri(appWindow.current_address);
}
Clipboard { id: clipboard }
- /* main layout */
- ColumnLayout {
- id: mainLayout
+ ListView {
+ id: subaddressListView
anchors.margins: 20
anchors.topMargin: 40
+ anchors.fill: parent
+ clip: true
+ boundsBehavior: ListView.StopAtBounds
+ reuseItems: true
+ cacheBuffer: 100
+ headerPositioning: ListView.InlineHeader
+ // Selecting a partially visible row must not scroll it or the inline header.
+ highlightFollowsCurrentItem: false
+
+ // Keep the top visible when the inline header changes height.
+ // TODO: Once Qt 6.12 is the minimum version, use a conditional Binding
+ // of contentY to originY while atYBeginning instead.
+ property real previousOriginY: 0
+ onOriginYChanged: {
+ if (contentY <= previousOriginY)
+ contentY = originY;
+ previousOriginY = originY;
+ }
- anchors.left: parent.left
- anchors.top: parent.top
- anchors.right: parent.right
+ onFlickingChanged: releaseFocus()
+
+ ScrollBar.vertical: ScrollBar {
+ id: subaddressScrollBar
+ policy: ScrollBar.AsNeeded
+ parent: pageReceive
+ anchors.top: parent.top
+ anchors.topMargin: 40
+ anchors.right: parent.right
+ anchors.rightMargin: 6
+ anchors.bottom: parent.bottom
+ anchors.bottomMargin: 20
+ active: !isMac || subaddressListView.moving || hovered || pressed
+ z: 2
+ palette.mid: "#8E8E93"
+ palette.dark: "#B8B8BD"
+ }
+
+ header: ColumnLayout {
+ id: mainLayout
+ width: subaddressListView.width
+ spacing: 15
+
+ function clearFields() {
+ amountToReceiveFiat.text = "";
+ amountToReceiveXMR.text = "";
+ txDescriptionInput.text = "";
+ receiverNameInput.text = "";
+ }
- spacing: 15
+ function generateQRCodeString() {
+ if (pageReceive.state == "PaymentRequest") {
+ return walletManager.make_uri(appWindow.current_address,
+ amountToReceiveXMR.text,
+ txDescriptionInput.text, receiverNameInput.text);
+ }
+ return walletManager.make_uri(appWindow.current_address);
+ }
ColumnLayout {
id: selectedAddressDetailsColumn
@@ -115,16 +168,16 @@ Rectangle {
Layout.bottomMargin: 10
MoneroComponents.NavbarItem {
- active: state == "Address"
+ active: pageReceive.state == "Address"
text: qsTr("Address") + translationManager.emptyString
- onSelected: state = "Address"
+ onSelected: pageReceive.state = "Address"
}
MoneroComponents.NavbarItem {
- active: state == "PaymentRequest"
+ active: pageReceive.state == "PaymentRequest"
text: qsTr("Payment request") + translationManager.emptyString
onSelected: {
- state = "PaymentRequest";
+ pageReceive.state = "PaymentRequest";
qrCodeTextMouseArea.hoverEnabled = true;
}
}
@@ -145,7 +198,7 @@ Rectangle {
anchors.margins: 1
smooth: false
fillMode: Image.PreserveAspectFit
- source: "image://qrcode/" + generateQRCodeString();
+ source: "image://qrcode/" + mainLayout.generateQRCodeString();
MouseArea {
anchors.fill: parent
@@ -439,7 +492,7 @@ Rectangle {
Layout.topMargin: 10
visible: pageReceive.state == "Address"
horizontalAlignment: Text.AlignHCenter
- text: "(" + qsTr("no label") + ")" + translationManager.emptyString
+ text: pageReceive.selectedAddressDescription
wrapMode: Text.WordWrap
font.family: MoneroComponents.Style.fontRegular.name
font.pixelSize: 17
@@ -509,12 +562,13 @@ Rectangle {
ColumnLayout {
id: addressRow
+ Layout.fillWidth: true
spacing: 0
RowLayout {
spacing: 0
- MoneroComponents.LabelSubheader {
+ MoneroComponents.Label {
Layout.fillWidth: true
fontSize: 24
textFormat: Text.RichText
@@ -532,50 +586,39 @@ Rectangle {
appWindow.currentWallet.subaddress.addRow(appWindow.currentWallet.currentSubaddressAccount, inputDialog.inputText)
current_subaddress_table_index = appWindow.currentWallet.numSubaddresses(appWindow.currentWallet.currentSubaddressAccount) - 1
subaddressListView.currentIndex = current_subaddress_table_index
+ subaddressListView.positionViewAtIndex(current_subaddress_table_index, ListView.Contain)
}
inputDialog.onRejectedCallback = null;
inputDialog.open()
}
- Rectangle {
- anchors.top: createAddressButton.bottom
- anchors.topMargin: 8
- anchors.left: createAddressButton.left
- anchors.right: createAddressButton.right
- height: 2
- color: MoneroComponents.Style.appWindowBorderColor
-
- MoneroEffects.ColorTransition {
- targetObj: parent
- blackColor: MoneroComponents.Style._b_appWindowBorderColor
- whiteColor: MoneroComponents.Style._w_appWindowBorderColor
- }
- }
}
}
- ColumnLayout {
- id: subaddressListRow
- property int subaddressListItemHeight: 50
- Layout.topMargin: 6
+ Rectangle {
Layout.fillWidth: true
- Layout.minimumWidth: 240
- Layout.preferredHeight: subaddressListItemHeight * subaddressListView.count
- visible: subaddressListView.count >= 1
+ Layout.topMargin: 8
+ Layout.preferredHeight: 2
+ color: MoneroComponents.Style.appWindowBorderColor
- ListView {
- id: subaddressListView
- Layout.fillWidth: true
- Layout.fillHeight: true
- clip: true
- boundsBehavior: ListView.StopAtBounds
- interactive: false
+ MoneroEffects.ColorTransition {
+ targetObj: parent
+ blackColor: MoneroComponents.Style._b_appWindowBorderColor
+ whiteColor: MoneroComponents.Style._w_appWindowBorderColor
+ }
+ }
+
+ }
- delegate: Rectangle {
+ }
+
+ delegate: Rectangle {
id: tableItem2
- height: subaddressListRow.subaddressListItemHeight
- width: parent ? parent.width : undefined
- Layout.fillWidth: true
+ required property int index
+ required property string address
+ required property string label
+ height: 50
+ width: subaddressListView.width
color: itemMouseArea.containsMouse || index === appWindow.current_subaddress_table_index ? MoneroComponents.Style.titleBarButtonHoverColor : "transparent"
Rectangle {
@@ -641,7 +684,7 @@ Rectangle {
anchors.leftMargin: -addressLabel.width - 5
fontSize: 16
fontFamily: MoneroComponents.Style.fontMonoRegular.name;
- text: TxUtils.addressTruncatePretty(address, mainLayout.width < 520 ? 1 : (mainLayout.width < 650 ? 2 : 3))
+ text: TxUtils.addressTruncatePretty(address, subaddressListView.width < 520 ? 1 : (subaddressListView.width < 650 ? 2 : 3))
themeTransition: false
}
@@ -711,29 +754,37 @@ Rectangle {
}
}
}
- onCurrentItemChanged: updateSelectedAddressDisplay()
- }
- }
- Rectangle {
- color: MoneroComponents.Style.appWindowBorderColor
- Layout.fillWidth: true
- height: 1
+ onCurrentItemChanged: updateSelectedAddressDisplay()
- MoneroEffects.ColorTransition {
- targetObj: parent
- blackColor: MoneroComponents.Style._b_appWindowBorderColor
- whiteColor: MoneroComponents.Style._w_appWindowBorderColor
- }
+ footer: Rectangle {
+ width: subaddressListView.width
+ height: 1
+ color: MoneroComponents.Style.appWindowBorderColor
+
+ MoneroEffects.ColorTransition {
+ targetObj: parent
+ blackColor: MoneroComponents.Style._b_appWindowBorderColor
+ whiteColor: MoneroComponents.Style._w_appWindowBorderColor
}
}
+ }
+
+ // Stop scrolling without consuming the first click on a row or control.
+ MouseArea {
+ anchors.fill: subaddressListView
+ onPressed: (mouse) => {
+ subaddressListView.cancelFlick();
+ mouse.accepted = false;
+ }
+ }
- MessageDialog {
+ MessageDialog {
id: receivePageDialog
buttons: MessageDialog.Ok
}
- FileDialog {
+ FileDialog {
id: qrFileDialog
title: qsTr("Please choose a name") + translationManager.emptyString
fileMode: FileDialog.SaveFile
@@ -748,29 +799,32 @@ Rectangle {
appWindow.showStatusMessage(qsTr("QR code saved to ") + walletManager.urlToLocalPath(selectedFile) + translationManager.emptyString, 3);
}
}
- }
}
function onPageCompleted() {
console.log("Receive page loaded");
pageReceive.clearFields();
- subaddressListView.model = appWindow.currentWallet.subaddressModel;
if (appWindow.currentWallet) {
+ subaddressListView.model = appWindow.currentWallet.subaddressModel;
appWindow.currentWallet.subaddress.refresh(appWindow.currentWallet.currentSubaddressAccount)
var numSubaddresses = appWindow.currentWallet.numSubaddresses(appWindow.currentWallet.currentSubaddressAccount);
if (subaddressListView.currentIndex == -1 || subaddressListView.currentIndex >= numSubaddresses) {
subaddressListView.currentIndex = 0;
}
updateSelectedAddressDisplay();
}
+ resetScroll();
+ }
+
+ function resetScroll() {
+ subaddressListView.positionViewAtBeginning();
}
function clearFields() {
- amountToReceiveFiat.text = "";
- amountToReceiveXMR.text = "";
- txDescriptionInput.text = "";
- receiverNameInput.text = "";
+ if (subaddressListView.headerItem) {
+ subaddressListView.headerItem.clearFields();
+ }
}
function onPageClosed() {Why this scored 19/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.