Correctly size the device list page

This commit is contained in:
miruka 2020-06-26 02:51:31 -04:00
parent eca801df4c
commit 2e610cf167
2 changed files with 13 additions and 1 deletions

View File

@ -2,10 +2,10 @@
- handle `{}` bad `DevicesResponse` - handle `{}` bad `DevicesResponse`
- delete devices (do that in key verification popup instead of blacklisting) - delete devices (do that in key verification popup instead of blacklisting)
- sessions page size
- flickshortcuts - flickshortcuts
- avatar upload/change component - avatar upload/change component
- device list keyboard navigation
- device IP geolocation - device IP geolocation
- field/area focus line in popups weird - field/area focus line in popups weird
- clear listview checked on message clear - clear listview checked on message clear

View File

@ -8,12 +8,22 @@ import "../../PythonBridge"
HColumnPage { HColumnPage {
id: page id: page
contentHeight: Math.min(
window.height,
Math.max(
deviceList.contentHeight + deviceList.bottomMargin,
busyIndicatorLoader.height + theme.spacing * 2,
)
)
property string userId property string userId
property Future loadFuture: null property Future loadFuture: null
// property var pr: column.childrenRect.height
// onPrChanged: print("pr changed:", pr, deviceList.implicitHeight)
function takeFocus() {} // XXX function takeFocus() {} // XXX
@ -79,6 +89,7 @@ HColumnPage {
// Don't bind directly to getSectionItemCounts(), laggy with big list // Don't bind directly to getSectionItemCounts(), laggy with big list
property var sectionItemCounts: ({}) property var sectionItemCounts: ({})
bottomMargin: theme.spacing
clip: true clip: true
model: ListModel {} model: ListModel {}
delegate: DeviceDelegate { delegate: DeviceDelegate {
@ -102,6 +113,7 @@ HColumnPage {
Layout.fillHeight: true Layout.fillHeight: true
HLoader { HLoader {
id: busyIndicatorLoader
anchors.centerIn: parent anchors.centerIn: parent
width: 96 * theme.uiScale width: 96 * theme.uiScale
height: width height: width