[haiku-commits] r35610 - haiku/trunk/src/kits/interface

  • From: superstippi@xxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Wed, 24 Feb 2010 21:41:31 +0100 (CET)

Author: stippi
Date: 2010-02-24 21:41:31 +0100 (Wed, 24 Feb 2010)
New Revision: 35610
Changeset: http://dev.haiku-os.org/changeset/35610/haiku

Modified:
   haiku/trunk/src/kits/interface/StatusBar.cpp
Log:
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.


Modified: haiku/trunk/src/kits/interface/StatusBar.cpp
===================================================================
--- haiku/trunk/src/kits/interface/StatusBar.cpp        2010-02-24 19:50:20 UTC 
(rev 35609)
+++ haiku/trunk/src/kits/interface/StatusBar.cpp        2010-02-24 20:41:31 UTC 
(rev 35610)
@@ -778,6 +778,8 @@
        else
                oldWidth = fTextDivider;
 
+       bool oldHasText = _HasText();
+
        text = source;
 
        BString newString;
@@ -797,6 +799,9 @@
        if (rightAligned)
                position = Bounds().right - invalidateWidth;
 
+       if (oldHasText != _HasText())
+               InvalidateLayout();
+
        font_height fontHeight;
        GetFontHeight(&fontHeight);
 
@@ -844,6 +849,10 @@
 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;
 }


Other related posts:

  • » [haiku-commits] r35610 - haiku/trunk/src/kits/interface - superstippi