Fix BrowserWindow to work with new layout changes.

git-svn-id: http://svn.haiku-os.org/webpositive/webkit/trunk@544 94f232f2-1747-11df-bad5-a5bfde151594
This commit is contained in:
anevilyak 2010-08-19 00:51:51 +00:00 committed by Alexandre Deckner
parent a071b4d041
commit 0e12634991

View File

@ -62,6 +62,7 @@
#include <GridLayoutBuilder.h> #include <GridLayoutBuilder.h>
#include <GroupLayout.h> #include <GroupLayout.h>
#include <GroupLayoutBuilder.h> #include <GroupLayoutBuilder.h>
#include <LayoutBuilder.h>
#include <MenuBar.h> #include <MenuBar.h>
#include <MenuItem.h> #include <MenuItem.h>
#include <MessageRunner.h> #include <MessageRunner.h>
@ -419,7 +420,7 @@ BrowserWindow::BrowserWindow(BRect frame, SettingsMessage* appSettings,
fFindCloseButton = new BButton("Close", fFindCloseButton = new BButton("Close",
new BMessage(EDIT_HIDE_FIND_GROUP)); new BMessage(EDIT_HIDE_FIND_GROUP));
fFindCaseSensitiveCheckBox = new BCheckBox("Match case"); fFindCaseSensitiveCheckBox = new BCheckBox("Match case");
BView* findGroup = BGroupLayoutBuilder(B_VERTICAL) BGroupLayout* findGroup = BLayoutBuilder::Group<>(B_VERTICAL)
.Add(new BSeparatorView(B_HORIZONTAL, B_PLAIN_BORDER)) .Add(new BSeparatorView(B_HORIZONTAL, B_PLAIN_BORDER))
.Add(BGroupLayoutBuilder(B_HORIZONTAL, kElementSpacing) .Add(BGroupLayoutBuilder(B_HORIZONTAL, kElementSpacing)
.Add(fFindTextControl) .Add(fFindTextControl)
@ -431,12 +432,11 @@ BrowserWindow::BrowserWindow(BRect frame, SettingsMessage* appSettings,
.SetInsets(kInsetSpacing, kInsetSpacing, .SetInsets(kInsetSpacing, kInsetSpacing,
kInsetSpacing, kInsetSpacing) kInsetSpacing, kInsetSpacing)
) )
.TopView()
; ;
// Navigation group // Navigation group
BView* navigationGroup = BGroupLayoutBuilder(B_VERTICAL) BGroupLayout* navigationGroup = BLayoutBuilder::Group<>(B_VERTICAL)
.Add(BGroupLayoutBuilder(B_HORIZONTAL, kElementSpacing) .Add(BLayoutBuilder::Group<>(B_HORIZONTAL, kElementSpacing)
.Add(fBackButton) .Add(fBackButton)
.Add(fForwardButton) .Add(fForwardButton)
.Add(fStopButton) .Add(fStopButton)
@ -446,19 +446,17 @@ BrowserWindow::BrowserWindow(BRect frame, SettingsMessage* appSettings,
kInsetSpacing) kInsetSpacing)
) )
.Add(new BSeparatorView(B_HORIZONTAL, B_PLAIN_BORDER)) .Add(new BSeparatorView(B_HORIZONTAL, B_PLAIN_BORDER))
.TopView()
; ;
// Status bar group // Status bar group
BView* statusGroup = BGroupLayoutBuilder(B_VERTICAL) BGroupLayout* statusGroup = BLayoutBuilder::Group<>(B_VERTICAL)
.Add(new BSeparatorView(B_HORIZONTAL, B_PLAIN_BORDER)) .Add(new BSeparatorView(B_HORIZONTAL, B_PLAIN_BORDER))
.Add(BGroupLayoutBuilder(B_HORIZONTAL, kElementSpacing) .Add(BLayoutBuilder::Group<>(B_HORIZONTAL, kElementSpacing)
.Add(fStatusText) .Add(fStatusText)
.Add(fLoadingProgressBar, 0.2) .Add(fLoadingProgressBar, 0.2)
.AddStrut(12 - kElementSpacing) .AddStrut(12 - kElementSpacing)
.SetInsets(kInsetSpacing, 0, kInsetSpacing, 0) .SetInsets(kInsetSpacing, 0, kInsetSpacing, 0)
) )
.TopView()
; ;
BitmapButton* toggleFullscreenButton = new BitmapButton(kWindowIconBits, BitmapButton* toggleFullscreenButton = new BitmapButton(kWindowIconBits,
@ -466,14 +464,13 @@ BrowserWindow::BrowserWindow(BRect frame, SettingsMessage* appSettings,
new BMessage(TOGGLE_FULLSCREEN)); new BMessage(TOGGLE_FULLSCREEN));
toggleFullscreenButton->SetBackgroundMode(BitmapButton::MENUBAR_BACKGROUND); toggleFullscreenButton->SetBackgroundMode(BitmapButton::MENUBAR_BACKGROUND);
BView* menuBarGroup = BGroupLayoutBuilder(B_HORIZONTAL) BGroupLayout* menuBarGroup = BLayoutBuilder::Group<>(B_HORIZONTAL)
.Add(mainMenu) .Add(mainMenu)
.Add(toggleFullscreenButton, 0.0f) .Add(toggleFullscreenButton, 0.0f)
.TopView()
; ;
// Layout // Layout
AddChild(BGroupLayoutBuilder(B_VERTICAL) AddChild(BLayoutBuilder::Group<>(B_VERTICAL)
#if !INTEGRATE_MENU_INTO_TAB_BAR #if !INTEGRATE_MENU_INTO_TAB_BAR
.Add(menuBarGroup) .Add(menuBarGroup)
#endif #endif
@ -490,11 +487,11 @@ BrowserWindow::BrowserWindow(BRect frame, SettingsMessage* appSettings,
fURLInputGroup->MakeFocus(true); fURLInputGroup->MakeFocus(true);
fMenuGroup = layoutItemFor(menuBarGroup); fMenuGroup = menuBarGroup;
fTabGroup = layoutItemFor(fTabManager->TabGroup()); fTabGroup = fTabManager->TabGroup()->GetLayout();
fNavigationGroup = layoutItemFor(navigationGroup); fNavigationGroup = navigationGroup;
fFindGroup = layoutItemFor(findGroup); fFindGroup = findGroup;
fStatusGroup = layoutItemFor(statusGroup); fStatusGroup = statusGroup;
fToggleFullscreenButton = layoutItemFor(toggleFullscreenButton); fToggleFullscreenButton = layoutItemFor(toggleFullscreenButton);
fFindGroup->SetVisible(false); fFindGroup->SetVisible(false);