ListItem: setting implicitHeight has no effect
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
ubuntu-ui-toolkit (Ubuntu) |
New
|
Undecided
|
Zsombor Egri |
Bug Description
ubuntu-
Description:
Creating a ListItem and setting its implicitHeight has no effect.
This means any component that derives from ListItem has to be implemented setting its height, while the best practice (as far as I know) is that components are supposed to set their implicit size, and leave the "real" size to the user of those components.
Investigation:
I spent some time on investigating this already. The problem is:
- http://
This means every time the width of the parent changes, ListItem will reset its implicit height to the default value. As a consequence, specifying a custom implicit height value is not allowed, because any parent's width change would cause it to be overwritten.
- http://
Testcase:
import QtQuick 2.4
import Ubuntu.Components 1.3
Item {
width: units.gu(42)
height: units.gu(75)
ListItem {
id: menu
//This is overridden on ListItem init and on every parent's width change.
//It is as if it weren't there
height: 5000
Rectangle {
color: "blue"
}
}
}
Changed in ubuntu-ui-toolkit (Ubuntu): | |
assignee: | nobody → Zsombor Egri (zsombi) |
I've noticed all this by using ListItemLayout's as ListItem main child, with variable height...
When resizing the main window, the items were collapsing
See attached videos.