Made the integrated menu bar a build time configuration feature. I don't like
it so much, since it somehow looks alien for no /really/ good reason. Maybe I'll integrate this option into the settings, when I get to those. git-svn-id: http://svn.haiku-os.org/webpositive/webkit/trunk@253 94f232f2-1747-11df-bad5-a5bfde151594
This commit is contained in:
committed by
Alexandre Deckner
parent
08d60e5886
commit
ddb431ba21
@@ -108,8 +108,11 @@ BrowserWindow::BrowserWindow(BRect frame, const BMessenger& downloadListener,
|
||||
|
||||
if (toolbarPolicy == HaveToolbar) {
|
||||
// Menu
|
||||
// BMenu* mainMenu = new BMenuBar("Main menu");
|
||||
#if INTEGRATE_MENU_INTO_TAB_BAR
|
||||
BMenu* mainMenu = fTabManager->Menu();
|
||||
#else
|
||||
BMenu* mainMenu = new BMenuBar("Main menu");
|
||||
#endif
|
||||
BMenu* menu = new BMenu("Window");
|
||||
BMessage* newWindowMessage = new BMessage(NEW_WINDOW);
|
||||
newWindowMessage->AddString("url", "");
|
||||
@@ -199,7 +202,9 @@ BrowserWindow::BrowserWindow(BRect frame, const BMessenger& downloadListener,
|
||||
;
|
||||
// Layout
|
||||
AddChild(BGroupLayoutBuilder(B_VERTICAL)
|
||||
// .Add(mainMenu)
|
||||
#if !INTEGRATE_MENU_INTO_TAB_BAR
|
||||
.Add(mainMenu)
|
||||
#endif
|
||||
.Add(fTabManager->TabGroup())
|
||||
.Add(BGridLayoutBuilder(kElementSpacing, kElementSpacing)
|
||||
.Add(fBackButton, 0, 0)
|
||||
|
||||
@@ -58,6 +58,8 @@ enum {
|
||||
SHOW_DOWNLOAD_WINDOW = 'sdwd'
|
||||
};
|
||||
|
||||
#define INTEGRATE_MENU_INTO_TAB_BAR 0
|
||||
|
||||
|
||||
class BrowserWindow : public BWebWindow {
|
||||
public:
|
||||
|
||||
@@ -1092,16 +1092,18 @@ TabManager::TabManager(const BMessenger& target, BMessage* newTabMessage)
|
||||
fCardLayout = new BCardLayout();
|
||||
fContainerView->SetLayout(fCardLayout);
|
||||
|
||||
fMenu = new BMenu("Menu");
|
||||
fTabContainerView = new TabContainerView(fController);
|
||||
fTabContainerGroup = new BGroupView(B_HORIZONTAL);
|
||||
fTabContainerGroup->GroupLayout()->SetInsets(0, 3, 0, 0);
|
||||
|
||||
#if INTEGRATE_MENU_INTO_TAB_BAR
|
||||
fMenu = new BMenu("Menu");
|
||||
BMenuBar* menuBar = new BMenuBar("Menu bar");
|
||||
menuBar->AddItem(fMenu);
|
||||
TabButtonContainer* menuBarContainer = new TabButtonContainer();
|
||||
menuBarContainer->GroupLayout()->AddView(menuBar);
|
||||
fTabContainerGroup->GroupLayout()->AddView(menuBarContainer, 0.0f);
|
||||
#endif
|
||||
|
||||
fTabContainerGroup->GroupLayout()->AddView(fTabContainerView);
|
||||
// fTabContainerGroup->GroupLayout()->AddView(new ScrollLeftTabButton(NULL), 0.0f);
|
||||
@@ -1133,11 +1135,13 @@ TabManager::Target() const
|
||||
}
|
||||
|
||||
|
||||
#if INTEGRATE_MENU_INTO_TAB_BAR
|
||||
BMenu*
|
||||
TabManager::Menu() const
|
||||
{
|
||||
return fMenu;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
BView*
|
||||
|
||||
@@ -51,7 +51,9 @@ public:
|
||||
void SetTarget(const BMessenger& target);
|
||||
const BMessenger& Target() const;
|
||||
|
||||
#if INTEGRATE_MENU_INTO_TAB_BAR
|
||||
BMenu* Menu() const;
|
||||
#endif
|
||||
|
||||
BView* TabGroup() const;
|
||||
BView* ContainerView() const;
|
||||
@@ -72,7 +74,9 @@ public:
|
||||
void SetCloseButtonsAvailable(bool available);
|
||||
|
||||
private:
|
||||
#if INTEGRATE_MENU_INTO_TAB_BAR
|
||||
BMenu* fMenu;
|
||||
#endif
|
||||
BGroupView* fTabContainerGroup;
|
||||
TabContainerView* fTabContainerView;
|
||||
BView* fContainerView;
|
||||
|
||||
Reference in New Issue
Block a user