From 7ee23666445626826430849982dd8655773b1f00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20A=C3=9Fmus?= Date: Wed, 24 Feb 2010 20:41:31 +0000 Subject: [PATCH] Fixed regression reported by Axel. If the BStatusBar is not running in layout mode, revert to the old behavior to include the room for the labels, even if there aren't any. Also in layouted mode, trigger a layout invalidation when switching from running without labels to using labels and vice versa. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35610 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kits/interface/StatusBar.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/kits/interface/StatusBar.cpp b/src/kits/interface/StatusBar.cpp index 5243a5af5e..7a6cdc89a4 100644 --- a/src/kits/interface/StatusBar.cpp +++ b/src/kits/interface/StatusBar.cpp @@ -778,6 +778,8 @@ BStatusBar::_SetTextData(BString& text, const char* source, else oldWidth = fTextDivider; + bool oldHasText = _HasText(); + text = source; BString newString; @@ -797,6 +799,9 @@ BStatusBar::_SetTextData(BString& text, const char* source, if (rightAligned) position = Bounds().right - invalidateWidth; + if (oldHasText != _HasText()) + InvalidateLayout(); + font_height fontHeight; GetFontHeight(&fontHeight); @@ -844,6 +849,10 @@ BStatusBar::_BarPosition(const BRect& barFrame) const bool BStatusBar::_HasText() const { + // Force BeOS behavior where the size of the BStatusBar always included + // room for labels, even when there weren't any. + if ((Flags() & B_SUPPORTS_LAYOUT) == 0) + return true; return fLabel.Length() > 0 || fTrailingLabel.Length() > 0 || fTrailingText.Length() > 0 || fText.Length() > 0; }