Skip to content
Closed
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
3 changes: 2 additions & 1 deletion qml/controls/InformationPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ Page {

background: null
clip: true
contentWidth: root.maximumWidth

header: NavigationBar {
id: navbar
Expand All @@ -60,7 +61,7 @@ Page {

ColumnLayout {
id: information
width: Math.min(parent.width, 600)
width: Math.min(parent.width, root.maximumWidth)
anchors.horizontalCenter: parent.horizontalCenter
spacing: 0
Loader {
Expand Down
1 change: 1 addition & 0 deletions qml/pages/settings/SettingsStorage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import "../../components"

InformationPage {
id: root
objectName: "settingsStoragePage"
property var settingsModel: optionsModel
property bool customStorage: false
property int customStorageAmount
Expand Down
4 changes: 3 additions & 1 deletion qml/pages/settings/SettingsWallet.qml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@ Page {

signal back
property bool showBackButton: true
readonly property int maximumContentWidth: 450

background: null
contentWidth: root.maximumContentWidth

header: SettingsHeader {
title: qsTr("External signer")
Expand All @@ -31,7 +33,7 @@ Page {
clip: true

ColumnLayout {
width: Math.min(parent.width, 450)
width: Math.min(parent.width, root.maximumContentWidth)
anchors.horizontalCenter: parent.horizontalCenter
spacing: 0

Expand Down
26 changes: 26 additions & 0 deletions test/qml/tst_nodesettings.qml
Original file line number Diff line number Diff line change
Expand Up @@ -250,4 +250,30 @@ TestCase {
verify(walletStack.depth > 1)
compare(walletSettingsPage.showBackButton, false)
}

function test_section_pages_keep_implicit_width_independent_of_layout() {
const page = createNodeSettingsPage()

const sections = [
{ index: 1, name: "settingsWallet" },
{ index: 4, name: "settingsStoragePage" },
{ index: 7, name: "mempoolInformationSettingsPage" }
]

for (let i = 0; i < sections.length; ++i) {
page.currentSection = sections[i].index
wait(0)

const sectionPage = findChild(page, sections[i].name)
verify(sectionPage !== null, sections[i].name + " was not created")

const implicitWidthBefore = sectionPage.implicitWidth
const widthBefore = sectionPage.width
sectionPage.width = widthBefore / 2
verify(sectionPage.width !== widthBefore,
sections[i].name + " ignored the width it was given")
compare(sectionPage.implicitWidth, implicitWidthBefore,
sections[i].name + " implicit width followed the width it was given")
}
}
}
Loading