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:
stippi
2012-07-03 15:30:47 +02:00
committed by Alexandre Deckner
parent 08d60e5886
commit ddb431ba21
4 changed files with 18 additions and 3 deletions
+7 -2
View File
@@ -108,8 +108,11 @@ BrowserWindow::BrowserWindow(BRect frame, const BMessenger& downloadListener,
if (toolbarPolicy == HaveToolbar) { if (toolbarPolicy == HaveToolbar) {
// Menu // Menu
// BMenu* mainMenu = new BMenuBar("Main menu"); #if INTEGRATE_MENU_INTO_TAB_BAR
BMenu* mainMenu = fTabManager->Menu(); BMenu* mainMenu = fTabManager->Menu();
#else
BMenu* mainMenu = new BMenuBar("Main menu");
#endif
BMenu* menu = new BMenu("Window"); BMenu* menu = new BMenu("Window");
BMessage* newWindowMessage = new BMessage(NEW_WINDOW); BMessage* newWindowMessage = new BMessage(NEW_WINDOW);
newWindowMessage->AddString("url", ""); newWindowMessage->AddString("url", "");
@@ -199,7 +202,9 @@ BrowserWindow::BrowserWindow(BRect frame, const BMessenger& downloadListener,
; ;
// Layout // Layout
AddChild(BGroupLayoutBuilder(B_VERTICAL) AddChild(BGroupLayoutBuilder(B_VERTICAL)
// .Add(mainMenu) #if !INTEGRATE_MENU_INTO_TAB_BAR
.Add(mainMenu)
#endif
.Add(fTabManager->TabGroup()) .Add(fTabManager->TabGroup())
.Add(BGridLayoutBuilder(kElementSpacing, kElementSpacing) .Add(BGridLayoutBuilder(kElementSpacing, kElementSpacing)
.Add(fBackButton, 0, 0) .Add(fBackButton, 0, 0)
+2
View File
@@ -58,6 +58,8 @@ enum {
SHOW_DOWNLOAD_WINDOW = 'sdwd' SHOW_DOWNLOAD_WINDOW = 'sdwd'
}; };
#define INTEGRATE_MENU_INTO_TAB_BAR 0
class BrowserWindow : public BWebWindow { class BrowserWindow : public BWebWindow {
public: public:
+5 -1
View File
@@ -1092,16 +1092,18 @@ TabManager::TabManager(const BMessenger& target, BMessage* newTabMessage)
fCardLayout = new BCardLayout(); fCardLayout = new BCardLayout();
fContainerView->SetLayout(fCardLayout); fContainerView->SetLayout(fCardLayout);
fMenu = new BMenu("Menu");
fTabContainerView = new TabContainerView(fController); fTabContainerView = new TabContainerView(fController);
fTabContainerGroup = new BGroupView(B_HORIZONTAL); fTabContainerGroup = new BGroupView(B_HORIZONTAL);
fTabContainerGroup->GroupLayout()->SetInsets(0, 3, 0, 0); fTabContainerGroup->GroupLayout()->SetInsets(0, 3, 0, 0);
#if INTEGRATE_MENU_INTO_TAB_BAR
fMenu = new BMenu("Menu");
BMenuBar* menuBar = new BMenuBar("Menu bar"); BMenuBar* menuBar = new BMenuBar("Menu bar");
menuBar->AddItem(fMenu); menuBar->AddItem(fMenu);
TabButtonContainer* menuBarContainer = new TabButtonContainer(); TabButtonContainer* menuBarContainer = new TabButtonContainer();
menuBarContainer->GroupLayout()->AddView(menuBar); menuBarContainer->GroupLayout()->AddView(menuBar);
fTabContainerGroup->GroupLayout()->AddView(menuBarContainer, 0.0f); fTabContainerGroup->GroupLayout()->AddView(menuBarContainer, 0.0f);
#endif
fTabContainerGroup->GroupLayout()->AddView(fTabContainerView); fTabContainerGroup->GroupLayout()->AddView(fTabContainerView);
// fTabContainerGroup->GroupLayout()->AddView(new ScrollLeftTabButton(NULL), 0.0f); // fTabContainerGroup->GroupLayout()->AddView(new ScrollLeftTabButton(NULL), 0.0f);
@@ -1133,11 +1135,13 @@ TabManager::Target() const
} }
#if INTEGRATE_MENU_INTO_TAB_BAR
BMenu* BMenu*
TabManager::Menu() const TabManager::Menu() const
{ {
return fMenu; return fMenu;
} }
#endif
BView* BView*
+4
View File
@@ -51,7 +51,9 @@ public:
void SetTarget(const BMessenger& target); void SetTarget(const BMessenger& target);
const BMessenger& Target() const; const BMessenger& Target() const;
#if INTEGRATE_MENU_INTO_TAB_BAR
BMenu* Menu() const; BMenu* Menu() const;
#endif
BView* TabGroup() const; BView* TabGroup() const;
BView* ContainerView() const; BView* ContainerView() const;
@@ -72,7 +74,9 @@ public:
void SetCloseButtonsAvailable(bool available); void SetCloseButtonsAvailable(bool available);
private: private:
#if INTEGRATE_MENU_INTO_TAB_BAR
BMenu* fMenu; BMenu* fMenu;
#endif
BGroupView* fTabContainerGroup; BGroupView* fTabContainerGroup;
TabContainerView* fTabContainerView; TabContainerView* fTabContainerView;
BView* fContainerView; BView* fContainerView;