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
This commit is contained in:
leavengood 2011-01-07 21:42:19 +00:00 committed by Alexandre Deckner
parent 255cade7a0
commit 552778e90c
1 changed files with 7 additions and 3 deletions

View File

@ -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