From d6a142a91285f4265f9e6c95aaab8a601573ed54 Mon Sep 17 00:00:00 2001 From: Philippe Saint-Pierre Date: Sat, 30 Jan 2010 20:33:48 +0000 Subject: [PATCH] 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 --- src/apps/expander/ExpanderWindow.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/apps/expander/ExpanderWindow.cpp b/src/apps/expander/ExpanderWindow.cpp index 8523b3c315..4fa2cb101c 100644 --- a/src/apps/expander/ExpanderWindow.cpp +++ b/src/apps/expander/ExpanderWindow.cpp @@ -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;