HBox: make buttons a column if not enough width

This commit is contained in:
miruka 2019-09-09 12:37:01 -04:00
parent a3b56519f7
commit 38781502c6
3 changed files with 25 additions and 3 deletions

View File

@ -1,4 +1,6 @@
- Refactoring
- Room header elide detection
- Use HBox for Profile
- Banners
- Composer
@ -94,7 +96,6 @@
- Server selection
- Register/Forgot? for SignIn dialog
- Add room
- Logout & leave/forget room warning popup
- Prevent using the composer if no permission (power levels)
- Prevent using an alias if that user is not in the room or no permission
- Spinner when loading past room events or images
@ -132,6 +133,7 @@
- Opening links with keyboard
- Client improvements
- More error details
- Refetch profile after manual profile change, don't wait for a room event
- Prevent starting multiple instances, causes problems with E2E DB
(sending new messages from second instances makes them undecryptable to

View File

@ -70,10 +70,13 @@ Rectangle {
Layout.rightMargin: interfaceBox.horizontalSpacing
}
HRowLayout {
HGridLayout {
id: buttonGrid
visible: buttonModel.length > 0
flow: width >= buttonRepeater.childrenImplicitWidth ?
GridLayout.LeftToRight : GridLayout.TopToBottom
Repeater {
HRepeater {
id: buttonRepeater
model: []

View File

@ -0,0 +1,17 @@
import QtQuick.Controls 2.12
import QtQuick 2.12
Repeater {
id: repeater
readonly property int childrenImplicitWidth: {
let total = 0
for (let i = 0; i < repeater.count; i++) {
total += repeater.itemAt(i).implicitWidth
}
return total
}
}