From 2e610cf167446b75a47eaf79626ca9e233f58263 Mon Sep 17 00:00:00 2001 From: miruka Date: Fri, 26 Jun 2020 02:51:31 -0400 Subject: [PATCH] Correctly size the device list page --- TODO.md | 2 +- src/gui/Pages/AccountSettings/Sessions.qml | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/TODO.md b/TODO.md index 5212fea9..9f0c0044 100644 --- a/TODO.md +++ b/TODO.md @@ -2,10 +2,10 @@ - handle `{}` bad `DevicesResponse` - delete devices (do that in key verification popup instead of blacklisting) -- sessions page size - flickshortcuts - avatar upload/change component +- device list keyboard navigation - device IP geolocation - field/area focus line in popups weird - clear listview checked on message clear diff --git a/src/gui/Pages/AccountSettings/Sessions.qml b/src/gui/Pages/AccountSettings/Sessions.qml index c5925158..00c4d027 100644 --- a/src/gui/Pages/AccountSettings/Sessions.qml +++ b/src/gui/Pages/AccountSettings/Sessions.qml @@ -8,12 +8,22 @@ import "../../PythonBridge" HColumnPage { id: page + contentHeight: Math.min( + window.height, + Math.max( + deviceList.contentHeight + deviceList.bottomMargin, + busyIndicatorLoader.height + theme.spacing * 2, + ) + ) property string userId property Future loadFuture: null + // property var pr: column.childrenRect.height + // onPrChanged: print("pr changed:", pr, deviceList.implicitHeight) + function takeFocus() {} // XXX @@ -79,6 +89,7 @@ HColumnPage { // Don't bind directly to getSectionItemCounts(), laggy with big list property var sectionItemCounts: ({}) + bottomMargin: theme.spacing clip: true model: ListModel {} delegate: DeviceDelegate { @@ -102,6 +113,7 @@ HColumnPage { Layout.fillHeight: true HLoader { + id: busyIndicatorLoader anchors.centerIn: parent width: 96 * theme.uiScale height: width