Auto-set maximumLineCount for elide in HLabel
This commit is contained in:
parent
6ae37dc31f
commit
4b2cbffc83
1
TODO.md
1
TODO.md
|
@ -1,4 +1,3 @@
|
||||||
- ElidedLabel component
|
|
||||||
- Can set `Layout.fillWidth: true` to elide/wrap
|
- Can set `Layout.fillWidth: true` to elide/wrap
|
||||||
- Use childrenRect stuff
|
- Use childrenRect stuff
|
||||||
- Rename theme.bottomElementsHeight
|
- Rename theme.bottomElementsHeight
|
||||||
|
|
|
@ -11,4 +11,6 @@ Label {
|
||||||
color: theme.colors.foreground
|
color: theme.colors.foreground
|
||||||
style: Label.Outline
|
style: Label.Outline
|
||||||
styleColor: theme.colors.textBorder
|
styleColor: theme.colors.textBorder
|
||||||
|
|
||||||
|
maximumLineCount: elide == Label.ElideNone ? Number.MAX_VALUE : 1
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,7 +35,6 @@ HRectangle {
|
||||||
HLabel {
|
HLabel {
|
||||||
id: bannerLabel
|
id: bannerLabel
|
||||||
textFormat: Text.StyledText
|
textFormat: Text.StyledText
|
||||||
maximumLineCount: 1
|
|
||||||
elide: Text.ElideRight
|
elide: Text.ElideRight
|
||||||
|
|
||||||
visible:
|
visible:
|
||||||
|
|
|
@ -34,7 +34,6 @@ HRectangle {
|
||||||
text: displayName
|
text: displayName
|
||||||
font.pixelSize: theme.fontSize.big
|
font.pixelSize: theme.fontSize.big
|
||||||
elide: Text.ElideRight
|
elide: Text.ElideRight
|
||||||
maximumLineCount: 1
|
|
||||||
|
|
||||||
Layout.maximumWidth: Math.max(
|
Layout.maximumWidth: Math.max(
|
||||||
0,
|
0,
|
||||||
|
@ -49,7 +48,6 @@ HRectangle {
|
||||||
text: topic
|
text: topic
|
||||||
font.pixelSize: theme.fontSize.small
|
font.pixelSize: theme.fontSize.small
|
||||||
elide: Text.ElideRight
|
elide: Text.ElideRight
|
||||||
maximumLineCount: 1
|
|
||||||
|
|
||||||
Layout.maximumWidth: Math.max(
|
Layout.maximumWidth: Math.max(
|
||||||
0,
|
0,
|
||||||
|
|
|
@ -36,7 +36,6 @@ HHighlightRectangle {
|
||||||
id: memberName
|
id: memberName
|
||||||
text: memberInfo.displayName || model.userId
|
text: memberInfo.displayName || model.userId
|
||||||
elide: Text.ElideRight
|
elide: Text.ElideRight
|
||||||
maximumLineCount: 1
|
|
||||||
verticalAlignment: Qt.AlignVCenter
|
verticalAlignment: Qt.AlignVCenter
|
||||||
|
|
||||||
Layout.maximumWidth: parent.width
|
Layout.maximumWidth: parent.width
|
||||||
|
|
|
@ -50,7 +50,6 @@ Row {
|
||||||
text: senderInfo.displayName || model.senderId
|
text: senderInfo.displayName || model.senderId
|
||||||
color: Utils.nameColor(avatar.name)
|
color: Utils.nameColor(avatar.name)
|
||||||
elide: Text.ElideRight
|
elide: Text.ElideRight
|
||||||
maximumLineCount: 1
|
|
||||||
horizontalAlignment: isOwn ? Text.AlignRight : Text.AlignLeft
|
horizontalAlignment: isOwn ? Text.AlignRight : Text.AlignLeft
|
||||||
|
|
||||||
leftPadding: horizontalPadding
|
leftPadding: horizontalPadding
|
||||||
|
|
|
@ -34,7 +34,6 @@ HRectangle {
|
||||||
text: chatPage.roomInfo.typingText
|
text: chatPage.roomInfo.typingText
|
||||||
textFormat: Text.StyledText
|
textFormat: Text.StyledText
|
||||||
elide: Text.ElideRight
|
elide: Text.ElideRight
|
||||||
maximumLineCount: 1
|
|
||||||
width: typingMembersBar.width - icon.width -
|
width: typingMembersBar.width - icon.width -
|
||||||
parent.spacing - parent.leftPadding - parent.rightPadding
|
parent.spacing - parent.leftPadding - parent.rightPadding
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,7 +42,6 @@ Page {
|
||||||
textFormat: Text.StyledText
|
textFormat: Text.StyledText
|
||||||
font.pixelSize: theme.fontSize.big
|
font.pixelSize: theme.fontSize.big
|
||||||
elide: Text.ElideRight
|
elide: Text.ElideRight
|
||||||
maximumLineCount: 1
|
|
||||||
horizontalAlignment: Text.AlignHCenter
|
horizontalAlignment: Text.AlignHCenter
|
||||||
|
|
||||||
Layout.leftMargin: currentSpacing
|
Layout.leftMargin: currentSpacing
|
||||||
|
|
|
@ -42,7 +42,6 @@ Column {
|
||||||
id: accountLabel
|
id: accountLabel
|
||||||
text: userInfo.displayName || model.userId
|
text: userInfo.displayName || model.userId
|
||||||
elide: HLabel.ElideRight
|
elide: HLabel.ElideRight
|
||||||
maximumLineCount: 1
|
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
leftPadding: sidePane.currentSpacing
|
leftPadding: sidePane.currentSpacing
|
||||||
rightPadding: leftPadding
|
rightPadding: leftPadding
|
||||||
|
|
|
@ -28,7 +28,6 @@ Column {
|
||||||
text: name
|
text: name
|
||||||
font.weight: Font.DemiBold
|
font.weight: Font.DemiBold
|
||||||
elide: Text.ElideRight
|
elide: Text.ElideRight
|
||||||
maximumLineCount: 1
|
|
||||||
|
|
||||||
Layout.leftMargin: sidePane.currentSpacing
|
Layout.leftMargin: sidePane.currentSpacing
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
|
|
|
@ -43,7 +43,6 @@ HHighlightRectangle {
|
||||||
textFormat:
|
textFormat:
|
||||||
model.displayName? Text.PlainText : Text.StyledText
|
model.displayName? Text.PlainText : Text.StyledText
|
||||||
elide: Text.ElideRight
|
elide: Text.ElideRight
|
||||||
maximumLineCount: 1
|
|
||||||
verticalAlignment: Qt.AlignVCenter
|
verticalAlignment: Qt.AlignVCenter
|
||||||
|
|
||||||
Layout.maximumWidth: parent.width
|
Layout.maximumWidth: parent.width
|
||||||
|
@ -73,7 +72,6 @@ HHighlightRectangle {
|
||||||
|
|
||||||
font.pixelSize: theme.fontSize.small
|
font.pixelSize: theme.fontSize.small
|
||||||
elide: Text.ElideRight
|
elide: Text.ElideRight
|
||||||
maximumLineCount: 1
|
|
||||||
|
|
||||||
Layout.maximumWidth: parent.width
|
Layout.maximumWidth: parent.width
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user