TokenSelectorPanel: tabs layout/sizing simplified

This commit is contained in:
Michał Cieślak 2024-09-20 10:32:16 +02:00 committed by Michał
parent 6a935d098c
commit 249e1ae042
2 changed files with 18 additions and 17 deletions

View File

@ -53,6 +53,8 @@ Control {
contentItem: StackView {
id: collectiblesStackView
implicitHeight: currentItem.implicitHeight
initialItem: ColumnLayout {
spacing: 0

View File

@ -72,28 +72,27 @@ Control {
}
}
StackLayout {
Layout.maximumHeight: 400
SearchableAssetsPanel {
id: searchableAssetsPanel
visible: !!root.assetsModel || !!root.collectiblesModel
currentIndex: tabBar.currentIndex
visible: tabBar.currentIndex === TokenSelectorPanel.Tabs.Assets
&& !!root.assetsModel
Layout.fillWidth: true
Layout.fillHeight: true
SearchableAssetsPanel {
id: searchableAssetsPanel
onSelected: root.assetSelected(key)
}
Layout.preferredHeight: visible ? implicitHeight : 0
SearchableCollectiblesPanel {
id: searchableCollectiblesPanel
onSelected: root.assetSelected(key)
}
visible: tabBar.currentIndex === TokenSelectorPanel.Tabs.Collectibles
&& !!root.collectiblesModel
Layout.fillWidth: true
Layout.fillHeight: true
SearchableCollectiblesPanel {
id: searchableCollectiblesPanel
Layout.preferredHeight: visible ? currentItem.implicitHeight : 0
onCollectibleSelected: root.collectibleSelected(key)
onCollectionSelected: root.collectionSelected(key)
}
onCollectibleSelected: root.collectibleSelected(key)
onCollectionSelected: root.collectionSelected(key)
}
}
}