Author: leavengood Date: Fri Jan 7 22:42:19 2011 New Revision: 573 URL: http://webpositive.haiku-os.org/changeset/573 Log: Align the tabs menu by using AttachedToWindow. Somewhat of a hack and I swear InvalidateLayout worked before, but it does not seem to now. Also use a const for an empty BString instead of returning a local for the tab label. Modified: webkit/trunk/WebKit/haiku/WebPositive/tabview/TabManager.cpp Modified: webkit/trunk/WebKit/haiku/WebPositive/tabview/TabManager.cpp ============================================================================== --- webkit/trunk/WebKit/haiku/WebPositive/tabview/TabManager.cpp Fri Jan 7 22:07:08 2011 (r572) +++ webkit/trunk/WebKit/haiku/WebPositive/tabview/TabManager.cpp Fri Jan 7 22:42:19 2011 (r573) @@ -48,6 +48,9 @@ #include "TabView.h" +const static BString kEmptyString; + + // #pragma mark - Helper classes @@ -265,8 +268,9 @@ } } - // Force layout to get the final menu size - tabMenu->InvalidateLayout(); + // Force layout to get the final menu size. InvalidateLayout() + // did not seem to work here. + tabMenu->AttachedToWindow(); BRect buttonFrame = fTabMenuButton->Frame(); BRect menuFrame = tabMenu->Frame(); BPoint openPoint = ConvertToScreen(buttonFrame.LeftBottom()); @@ -911,7 +915,7 @@ if (tab) return tab->Label(); else - return ""; + return kEmptyString; } void