From d12f7861f75153bf47189057f05f394b46fcbf3a Mon Sep 17 00:00:00 2001 From: reionwong Date: Thu, 21 Oct 2021 16:41:44 +0800 Subject: [PATCH] Fix WLAN view height --- src/qml/WLAN/WifiView.qml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/qml/WLAN/WifiView.qml b/src/qml/WLAN/WifiView.qml index b1fee9f..2cc7b8e 100644 --- a/src/qml/WLAN/WifiView.qml +++ b/src/qml/WLAN/WifiView.qml @@ -65,7 +65,15 @@ ColumnLayout { ListView { id: wirelessView Layout.fillWidth: true - Layout.preferredHeight: itemHeight * count + ((count - 1) * spacing) + + Layout.preferredHeight: { + var totalHeight = 0 + for (var i = 0; i < wirelessView.visibleChildren.length; ++i) { + totalHeight += wirelessView.visibleChildren[i].height + } + return totalHeight + } + clip: true model: NM.AppletProxyModel { @@ -77,8 +85,6 @@ ColumnLayout { interactive: false visible: count > 0 - property var itemHeight: 38 - delegate: WifiItem { width: ListView.view.width // height: ListView.view.itemHeight