fix(StatusListItem): don't set width on title item

There was an explicit `width` introduced on `statusListItemTitle`, most likely
to make room for it when `titleAsideText` is supplied.

This unfortunately causes the title get a very small width, resulting in broken
UI.

Since we can assume that there should be enough space for the titleAsideText
when it's used, we probably don't have to calculate a fixed width for the title
in the first place.

This commit therefore removes that explicit setting.
This commit is contained in:
Pascal Precht 2021-08-26 12:18:56 +02:00 committed by Michał Cieślak
parent cebfe60d50
commit dfcf6e07f1
2 changed files with 5 additions and 2 deletions

View File

@ -289,6 +289,11 @@ CExPynn1gWf9bx498P7/nzPcxEzGExhBdJGYihtAYQlO+tUZvqrPbqeudo5iJGEJjCE15a3VtodH3q2I
icon.background.color: "orange" icon.background.color: "orange"
} }
StatusListItem {
title: "Title"
titleAsideText: "test"
}
StatusListItem { StatusListItem {
title: "Title" title: "Title"
icon.name: "delete" icon.name: "delete"

View File

@ -179,8 +179,6 @@ Rectangle {
StatusBaseText { StatusBaseText {
id: statusListItemTitle id: statusListItemTitle
text: statusListItem.title text: statusListItem.title
width: contentWidth < (parent.width - statusListItemTitleAsideText.contentWidth) ?
contentWidth : (parent.width - statusListItemTitleAsideText.contentWidth)
font.pixelSize: 15 font.pixelSize: 15
height: visible ? contentHeight : 0 height: visible ? contentHeight : 0
wrapMode: Text.WrapAtWordBoundaryOrAnywhere wrapMode: Text.WrapAtWordBoundaryOrAnywhere