Expander: don't use fLineHeight before its value is calculated. And don't resize the window to a size smaller than the calculated minHeight.
* This fixes a bug where checking "show contents" before a source archive is chosen makes the window go tiny. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35350 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -593,8 +593,6 @@ ExpanderWindow::_UpdateWindowSize(bool showContents)
|
||||
float bottom = fSizeLimit;
|
||||
|
||||
if (showContents) {
|
||||
minHeight = bottom + 5.0 * fLineHeight;
|
||||
maxHeight = 32767.0;
|
||||
if (fPreviousHeight < 0.0) {
|
||||
BFont font;
|
||||
font_height fontHeight;
|
||||
@@ -602,10 +600,12 @@ ExpanderWindow::_UpdateWindowSize(bool showContents)
|
||||
font.GetHeight(&fontHeight);
|
||||
fLineHeight = ceilf(fontHeight.ascent + fontHeight.descent
|
||||
+ fontHeight.leading);
|
||||
|
||||
fPreviousHeight = minHeight + 10.0 * fLineHeight;
|
||||
fPreviousHeight = bottom + 10.0 * fLineHeight;
|
||||
}
|
||||
bottom = fPreviousHeight;
|
||||
minHeight = bottom + 5.0 * fLineHeight;
|
||||
maxHeight = 32767.0;
|
||||
|
||||
bottom = max_c(fPreviousHeight, minHeight);
|
||||
} else {
|
||||
minHeight = fSizeLimit;
|
||||
maxHeight = fSizeLimit;
|
||||
|
||||
Reference in New Issue
Block a user