From 552778e90ca6fb2df4728cb2fe4d5279039980c3 Mon Sep 17 00:00:00 2001 From: leavengood Date: Fri, 7 Jan 2011 21:42:19 +0000 Subject: [PATCH] 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. git-svn-id: http://svn.haiku-os.org/webpositive/webkit/trunk@573 94f232f2-1747-11df-bad5-a5bfde151594 --- src/apps/webpositive/tabview/TabManager.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/apps/webpositive/tabview/TabManager.cpp b/src/apps/webpositive/tabview/TabManager.cpp index dc3fbb0251..f25b67769d 100644 --- a/src/apps/webpositive/tabview/TabManager.cpp +++ b/src/apps/webpositive/tabview/TabManager.cpp @@ -48,6 +48,9 @@ #include "TabView.h" +const static BString kEmptyString; + + // #pragma mark - Helper classes @@ -265,8 +268,9 @@ public: } } - // 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 @@ TabManager::TabLabel(int32 tabIndex) if (tab) return tab->Label(); else - return ""; + return kEmptyString; } void