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;
|
float bottom = fSizeLimit;
|
||||||
|
|
||||||
if (showContents) {
|
if (showContents) {
|
||||||
minHeight = bottom + 5.0 * fLineHeight;
|
|
||||||
maxHeight = 32767.0;
|
|
||||||
if (fPreviousHeight < 0.0) {
|
if (fPreviousHeight < 0.0) {
|
||||||
BFont font;
|
BFont font;
|
||||||
font_height fontHeight;
|
font_height fontHeight;
|
||||||
@@ -602,10 +600,12 @@ ExpanderWindow::_UpdateWindowSize(bool showContents)
|
|||||||
font.GetHeight(&fontHeight);
|
font.GetHeight(&fontHeight);
|
||||||
fLineHeight = ceilf(fontHeight.ascent + fontHeight.descent
|
fLineHeight = ceilf(fontHeight.ascent + fontHeight.descent
|
||||||
+ fontHeight.leading);
|
+ fontHeight.leading);
|
||||||
|
fPreviousHeight = bottom + 10.0 * fLineHeight;
|
||||||
fPreviousHeight = minHeight + 10.0 * fLineHeight;
|
|
||||||
}
|
}
|
||||||
bottom = fPreviousHeight;
|
minHeight = bottom + 5.0 * fLineHeight;
|
||||||
|
maxHeight = 32767.0;
|
||||||
|
|
||||||
|
bottom = max_c(fPreviousHeight, minHeight);
|
||||||
} else {
|
} else {
|
||||||
minHeight = fSizeLimit;
|
minHeight = fSizeLimit;
|
||||||
maxHeight = fSizeLimit;
|
maxHeight = fSizeLimit;
|
||||||
|
|||||||
Reference in New Issue
Block a user