Skip to content

Commit

Permalink
TokenSelectorPanel: tabs layout/sizing simplified
Browse files Browse the repository at this point in the history
  • Loading branch information
micieslak committed Sep 20, 2024
1 parent fc39b41 commit ee3bf86
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ Control {
contentItem: StackView {
id: collectiblesStackView

implicitHeight: currentItem.implicitHeight

initialItem: ColumnLayout {
spacing: 0

Expand Down
33 changes: 16 additions & 17 deletions ui/app/AppLayouts/Wallet/panels/TokenSelectorPanel.qml
Original file line number Diff line number Diff line change
Expand Up @@ -72,28 +72,27 @@ Control {
}
}

StackLayout {
Layout.maximumHeight: 400
SearchableAssetsPanel {
id: searchableAssetsPanel

visible: !!root.assetsModel || !!root.collectiblesModel
currentIndex: tabBar.currentIndex

SearchableAssetsPanel {
id: searchableAssetsPanel

Layout.preferredHeight: visible ? implicitHeight : 0
visible: tabBar.currentIndex === TokenSelectorPanel.Tabs.Assets
&& !!root.assetsModel
Layout.fillWidth: true
Layout.fillHeight: true

onSelected: root.assetSelected(key)
}
onSelected: root.assetSelected(key)
}

SearchableCollectiblesPanel {
id: searchableCollectiblesPanel
SearchableCollectiblesPanel {
id: searchableCollectiblesPanel

Layout.preferredHeight: visible ? currentItem.implicitHeight : 0
visible: tabBar.currentIndex === TokenSelectorPanel.Tabs.Collectibles
&& !!root.collectiblesModel
Layout.fillWidth: true
Layout.fillHeight: true

onCollectibleSelected: root.collectibleSelected(key)
onCollectionSelected: root.collectionSelected(key)
}
onCollectibleSelected: root.collectibleSelected(key)
onCollectionSelected: root.collectionSelected(key)
}
}
}

0 comments on commit ee3bf86

Please sign in to comment.