wrap/elide: use Layout.fillWidth when possible

This commit is contained in:
miruka 2019-07-16 05:08:27 -04:00
parent 7f46bafc9e
commit d5dd1292ff
8 changed files with 18 additions and 21 deletions

View File

@ -1,4 +1,3 @@
- Can set `Layout.fillWidth: true` to elide/wrap
- Use childrenRect stuff - Use childrenRect stuff
- Rename theme.bottomElementsHeight - Rename theme.bottomElementsHeight
- Account delegate name color - Account delegate name color

View File

@ -40,11 +40,7 @@ HRectangle {
visible: visible:
bannerRow.width - bannerAvatar.width - bannerButtons.width > 30 bannerRow.width - bannerAvatar.width - bannerButtons.width > 30
Layout.maximumWidth: Layout.fillWidth: true
bannerRow.width -
bannerAvatar.width - bannerButtons.width -
Layout.leftMargin - Layout.rightMargin
Layout.leftMargin: 5 Layout.leftMargin: 5
Layout.rightMargin: Layout.leftMargin Layout.rightMargin: Layout.leftMargin
} }

View File

@ -38,7 +38,7 @@ HHighlightRectangle {
elide: Text.ElideRight elide: Text.ElideRight
verticalAlignment: Qt.AlignVCenter verticalAlignment: Qt.AlignVCenter
Layout.maximumWidth: parent.width Layout.fillWidth: true
} }
} }
} }

View File

@ -78,6 +78,7 @@ HGridLayout {
color: Qt.hsla(0, 0, 0.9, 1) color: Qt.hsla(0, 0, 0.9, 1)
font.pixelSize: theme.fontSize.big font.pixelSize: theme.fontSize.big
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
Layout.fillWidth: true Layout.fillWidth: true
Layout.alignment: Qt.AlignCenter Layout.alignment: Qt.AlignCenter
} }

View File

@ -41,7 +41,7 @@ Item {
wrapMode: Text.Wrap wrapMode: Text.Wrap
Layout.margins: rememberBox.margins Layout.margins: rememberBox.margins
Layout.maximumWidth: rememberBox.width - Layout.margins * 2 Layout.fillWidth: true
} }
HSpacer {} HSpacer {}

View File

@ -41,10 +41,11 @@ Column {
HLabel { HLabel {
id: accountLabel id: accountLabel
text: userInfo.displayName || model.userId text: userInfo.displayName || model.userId
elide: HLabel.ElideRight
Layout.fillWidth: true
leftPadding: sidePane.currentSpacing leftPadding: sidePane.currentSpacing
rightPadding: leftPadding rightPadding: leftPadding
elide: HLabel.ElideRight
Layout.fillWidth: true
} }
HTextField { HTextField {

View File

@ -45,7 +45,7 @@ HHighlightRectangle {
elide: Text.ElideRight elide: Text.ElideRight
verticalAlignment: Qt.AlignVCenter verticalAlignment: Qt.AlignVCenter
Layout.maximumWidth: parent.width Layout.fillWidth: true
} }
HRichLabel { HRichLabel {
@ -73,7 +73,7 @@ HHighlightRectangle {
font.pixelSize: theme.fontSize.small font.pixelSize: theme.fontSize.small
elide: Text.ElideRight elide: Text.ElideRight
Layout.maximumWidth: parent.width Layout.fillWidth: true
} }
} }
} }

View File

@ -86,17 +86,17 @@ Item {
Timer { Timer {
// TODO: remove this, debug // TODO: remove this, debug
id: initialRoomTimer id: initialRoomTimer
interval: 2000 interval: 5000
repeat: false repeat: false
// onTriggered: pageStack.showRoom( onTriggered: pageStack.showRoom(
// "@test_mary:matrix.org", "@test_mary:matrix.org",
// "Rooms", "Rooms",
// "!TSXGsbBbdwsdylIOJZ:matrix.org" "!TSXGsbBbdwsdylIOJZ:matrix.org"
// )
onTriggered: pageStack.showPage(
"EditAccount/EditAccount",
{"userId": "@test_mary:matrix.org"}
) )
// onTriggered: pageStack.showPage(
// "EditAccount/EditAccount",
// {"userId": "@test_mary:matrix.org"}
// )
} }
onCurrentItemChanged: if (currentItem) { onCurrentItemChanged: if (currentItem) {