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
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user