I accidentally removed some backwards compatible behavior. When there is no
label, a TextControl maintains it's current width in ResizeToPreferred() if it is wide enough. Should fix #2751. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27646 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -467,8 +467,15 @@ BTextControl::GetPreferredSize(float *_width, float *_height)
|
|||||||
|
|
||||||
_ValidateLayoutData();
|
_ValidateLayoutData();
|
||||||
|
|
||||||
if (_width)
|
if (_width) {
|
||||||
*_width = fLayoutData->min.width;
|
float minWidth = fLayoutData->min.width;
|
||||||
|
if (Label() == NULL && !(Flags() & B_SUPPORTS_LAYOUT)) {
|
||||||
|
// Indeed, only if there is no label! BeOS backwards compatible
|
||||||
|
// behavior:
|
||||||
|
minWidth = max_c(minWidth, Bounds().Width());
|
||||||
|
}
|
||||||
|
*_width = minWidth;
|
||||||
|
}
|
||||||
|
|
||||||
if (_height)
|
if (_height)
|
||||||
*_height = fLayoutData->min.height;
|
*_height = fLayoutData->min.height;
|
||||||
|
|||||||
Reference in New Issue
Block a user