From ee3bf8601ad18eac65b03cb3a0d164f32d9c3d53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Cie=C5=9Blak?= Date: Fri, 20 Sep 2024 10:32:16 +0200 Subject: [PATCH] TokenSelectorPanel: tabs layout/sizing simplified --- .../panels/SearchableCollectiblesPanel.qml | 2 ++ .../Wallet/panels/TokenSelectorPanel.qml | 33 +++++++++---------- 2 files changed, 18 insertions(+), 17 deletions(-) diff --git a/ui/app/AppLayouts/Wallet/panels/SearchableCollectiblesPanel.qml b/ui/app/AppLayouts/Wallet/panels/SearchableCollectiblesPanel.qml index 17d9d34c938..79b70786025 100644 --- a/ui/app/AppLayouts/Wallet/panels/SearchableCollectiblesPanel.qml +++ b/ui/app/AppLayouts/Wallet/panels/SearchableCollectiblesPanel.qml @@ -53,6 +53,8 @@ Control { contentItem: StackView { id: collectiblesStackView + implicitHeight: currentItem.implicitHeight + initialItem: ColumnLayout { spacing: 0 diff --git a/ui/app/AppLayouts/Wallet/panels/TokenSelectorPanel.qml b/ui/app/AppLayouts/Wallet/panels/TokenSelectorPanel.qml index 1a9aa6b8ad5..1459c00065c 100644 --- a/ui/app/AppLayouts/Wallet/panels/TokenSelectorPanel.qml +++ b/ui/app/AppLayouts/Wallet/panels/TokenSelectorPanel.qml @@ -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) } } }