Author: stpere Date: 2010-01-30 21:33:48 +0100 (Sat, 30 Jan 2010) New Revision: 35350 Changeset: http://dev.haiku-os.org/changeset/35350/haiku Modified: haiku/trunk/src/apps/expander/ExpanderWindow.cpp Log: 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. Modified: haiku/trunk/src/apps/expander/ExpanderWindow.cpp =================================================================== --- haiku/trunk/src/apps/expander/ExpanderWindow.cpp 2010-01-30 19:04:45 UTC (rev 35349) +++ haiku/trunk/src/apps/expander/ExpanderWindow.cpp 2010-01-30 20:33:48 UTC (rev 35350) @@ -593,8 +593,6 @@ 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 @@ 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;