diff --git a/src/apps/webpositive/BrowserWindow.cpp b/src/apps/webpositive/BrowserWindow.cpp index 6fc92f8b65..0fa866009e 100644 --- a/src/apps/webpositive/BrowserWindow.cpp +++ b/src/apps/webpositive/BrowserWindow.cpp @@ -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) diff --git a/src/apps/webpositive/BrowserWindow.h b/src/apps/webpositive/BrowserWindow.h index e245f4d576..568a49670a 100644 --- a/src/apps/webpositive/BrowserWindow.h +++ b/src/apps/webpositive/BrowserWindow.h @@ -58,6 +58,8 @@ enum { SHOW_DOWNLOAD_WINDOW = 'sdwd' }; +#define INTEGRATE_MENU_INTO_TAB_BAR 0 + class BrowserWindow : public BWebWindow { public: diff --git a/src/apps/webpositive/WebTabView.cpp b/src/apps/webpositive/WebTabView.cpp index b96e4a4fe9..a4e073dc40 100644 --- a/src/apps/webpositive/WebTabView.cpp +++ b/src/apps/webpositive/WebTabView.cpp @@ -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* diff --git a/src/apps/webpositive/WebTabView.h b/src/apps/webpositive/WebTabView.h index e6d6c3abcd..69d7a032d9 100644 --- a/src/apps/webpositive/WebTabView.h +++ b/src/apps/webpositive/WebTabView.h @@ -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;