Added button besides main menu bar which is only visible in fullscreen mode and
allows to go back to window'ed mode. The icon is the window icon which Deskbar uses also. git-svn-id: http://svn.haiku-os.org/webpositive/webkit/trunk@484 94f232f2-1747-11df-bad5-a5bfde151594
This commit is contained in:
committed by
Alexandre Deckner
parent
095c4241ef
commit
c0f79c0321
@@ -35,6 +35,7 @@
|
|||||||
|
|
||||||
#include "AuthenticationPanel.h"
|
#include "AuthenticationPanel.h"
|
||||||
#include "BaseURL.h"
|
#include "BaseURL.h"
|
||||||
|
#include "BitmapButton.h"
|
||||||
#include "BrowserApp.h"
|
#include "BrowserApp.h"
|
||||||
#include "BrowsingHistory.h"
|
#include "BrowsingHistory.h"
|
||||||
#include "CredentialsStorage.h"
|
#include "CredentialsStorage.h"
|
||||||
@@ -47,6 +48,7 @@
|
|||||||
#include "WebPage.h"
|
#include "WebPage.h"
|
||||||
#include "WebView.h"
|
#include "WebView.h"
|
||||||
#include "WebViewConstants.h"
|
#include "WebViewConstants.h"
|
||||||
|
#include "WindowIcon.h"
|
||||||
#include <Alert.h>
|
#include <Alert.h>
|
||||||
#include <Application.h>
|
#include <Application.h>
|
||||||
#include <Bitmap.h>
|
#include <Bitmap.h>
|
||||||
@@ -376,10 +378,18 @@ BrowserWindow::BrowserWindow(BRect frame, SettingsMessage* appSettings,
|
|||||||
.SetInsets(kInsetSpacing, 0, kInsetSpacing, 0)
|
.SetInsets(kInsetSpacing, 0, kInsetSpacing, 0)
|
||||||
;
|
;
|
||||||
|
|
||||||
|
BitmapButton* toggleFullscreenButton = new BitmapButton(kWindowIconBits,
|
||||||
|
kWindowIconWidth, kWindowIconHeight, kWindowIconFormat,
|
||||||
|
new BMessage(TOGGLE_FULLSCREEN));
|
||||||
|
toggleFullscreenButton->SetBackgroundMode(BitmapButton::MENUBAR_BACKGROUND);
|
||||||
|
|
||||||
// Layout
|
// Layout
|
||||||
AddChild(BGroupLayoutBuilder(B_VERTICAL)
|
AddChild(BGroupLayoutBuilder(B_VERTICAL)
|
||||||
#if !INTEGRATE_MENU_INTO_TAB_BAR
|
#if !INTEGRATE_MENU_INTO_TAB_BAR
|
||||||
.Add(mainMenu)
|
.Add(BGroupLayoutBuilder(B_HORIZONTAL)
|
||||||
|
.Add(mainMenu)
|
||||||
|
.Add(toggleFullscreenButton, 0.0f)
|
||||||
|
)
|
||||||
#endif
|
#endif
|
||||||
.Add(fTabManager->TabGroup())
|
.Add(fTabManager->TabGroup())
|
||||||
.Add(navigationGroup)
|
.Add(navigationGroup)
|
||||||
@@ -400,10 +410,12 @@ BrowserWindow::BrowserWindow(BRect frame, SettingsMessage* appSettings,
|
|||||||
fNavigationGroup = layoutItemFor(navigationGroup);
|
fNavigationGroup = layoutItemFor(navigationGroup);
|
||||||
fFindGroup = layoutItemFor(findGroup);
|
fFindGroup = layoutItemFor(findGroup);
|
||||||
fStatusGroup = layoutItemFor(statusGroup);
|
fStatusGroup = layoutItemFor(statusGroup);
|
||||||
|
fToggleFullscreenButton = layoutItemFor(toggleFullscreenButton);
|
||||||
CreateNewTab(url, true, webView);
|
|
||||||
|
|
||||||
fFindGroup->SetVisible(false);
|
fFindGroup->SetVisible(false);
|
||||||
|
fToggleFullscreenButton->SetVisible(false);
|
||||||
|
|
||||||
|
CreateNewTab(url, true, webView);
|
||||||
|
|
||||||
if (toolbarPolicy == DoNotHaveToolbar) {
|
if (toolbarPolicy == DoNotHaveToolbar) {
|
||||||
#if !INTEGRATE_MENU_INTO_TAB_BAR
|
#if !INTEGRATE_MENU_INTO_TAB_BAR
|
||||||
@@ -1750,6 +1762,7 @@ BrowserWindow::_ToggleFullscreen()
|
|||||||
}
|
}
|
||||||
fIsFullscreen = !fIsFullscreen;
|
fIsFullscreen = !fIsFullscreen;
|
||||||
fFullscreenItem->SetMarked(fIsFullscreen);
|
fFullscreenItem->SetMarked(fIsFullscreen);
|
||||||
|
fToggleFullscreenButton->SetVisible(fIsFullscreen);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -199,6 +199,7 @@ private:
|
|||||||
BLayoutItem* fNavigationGroup;
|
BLayoutItem* fNavigationGroup;
|
||||||
BLayoutItem* fFindGroup;
|
BLayoutItem* fFindGroup;
|
||||||
BLayoutItem* fStatusGroup;
|
BLayoutItem* fStatusGroup;
|
||||||
|
BLayoutItem* fToggleFullscreenButton;
|
||||||
|
|
||||||
BTextControl* fFindTextControl;
|
BTextControl* fFindTextControl;
|
||||||
BCheckBox* fFindCaseSensitiveCheckBox;
|
BCheckBox* fFindCaseSensitiveCheckBox;
|
||||||
|
|||||||
@@ -80,6 +80,9 @@ BitmapButton::Draw(BRect updateRect)
|
|||||||
be_control_look->DrawButtonBackground(this, bounds, updateRect, base,
|
be_control_look->DrawButtonBackground(this, bounds, updateRect, base,
|
||||||
flags);
|
flags);
|
||||||
} else {
|
} else {
|
||||||
|
SetHighColor(tint_color(base, B_DARKEN_2_TINT));
|
||||||
|
StrokeLine(bounds.LeftBottom(), bounds.RightBottom());
|
||||||
|
bounds.bottom--;
|
||||||
be_control_look->DrawMenuBarBackground(this, bounds, updateRect, base,
|
be_control_look->DrawMenuBarBackground(this, bounds, updateRect, base,
|
||||||
flags);
|
flags);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,54 @@
|
|||||||
|
|
||||||
|
const uint32 kWindowIconWidth = 13;
|
||||||
|
const uint32 kWindowIconHeight = 14;
|
||||||
|
const color_space kWindowIconFormat = B_RGBA32;
|
||||||
|
|
||||||
|
const unsigned char kWindowIconBits[] = {
|
||||||
|
0x78, 0x78, 0x78, 0xff, 0x78, 0x78, 0x78, 0xff, 0x78, 0x78, 0x78, 0xff, 0x78, 0x78, 0x78, 0xff,
|
||||||
|
0x78, 0x78, 0x78, 0xff, 0x78, 0x78, 0x78, 0xff, 0x78, 0x78, 0x78, 0xff, 0x78, 0x78, 0x78, 0xff,
|
||||||
|
0x78, 0x78, 0x78, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x78, 0x78, 0x78, 0xff, 0x66, 0xff, 0xff, 0xff, 0x66, 0xff, 0xff, 0xff,
|
||||||
|
0x66, 0xff, 0xff, 0xff, 0x66, 0xff, 0xff, 0xff, 0x66, 0xff, 0xff, 0xff, 0x66, 0xff, 0xff, 0xff,
|
||||||
|
0x66, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x78, 0x78, 0xff, 0x13, 0xaf, 0xff, 0xff,
|
||||||
|
0x13, 0xaf, 0xff, 0xff, 0x13, 0xaf, 0xff, 0xff, 0x13, 0xaf, 0xff, 0xff, 0x13, 0xaf, 0xff, 0xff,
|
||||||
|
0x13, 0xaf, 0xff, 0xff, 0x13, 0xaf, 0xff, 0xff, 0x78, 0x78, 0x78, 0xff, 0x78, 0x78, 0x78, 0xff,
|
||||||
|
0x78, 0x78, 0x78, 0xff, 0x78, 0x78, 0x78, 0xff, 0x78, 0x78, 0x78, 0xff, 0x78, 0x78, 0x78, 0xff,
|
||||||
|
0xc8, 0xc8, 0xc8, 0xff, 0xc8, 0xc8, 0xc8, 0xff, 0xc8, 0xc8, 0xc8, 0xff, 0xc8, 0xc8, 0xc8, 0xff,
|
||||||
|
0xc8, 0xc8, 0xc8, 0xff, 0xc8, 0xc8, 0xc8, 0xff, 0xc8, 0xc8, 0xc8, 0xff, 0xc8, 0xc8, 0xc8, 0xff,
|
||||||
|
0xc8, 0xc8, 0xc8, 0xff, 0xc8, 0xc8, 0xc8, 0xff, 0xc8, 0xc8, 0xc8, 0xff, 0x00, 0x00, 0x00, 0xff,
|
||||||
|
0x78, 0x78, 0x78, 0xff, 0xc8, 0xc8, 0xc8, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||||
|
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||||
|
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc8, 0xc8, 0xc8, 0xff,
|
||||||
|
0x00, 0x00, 0x00, 0xff, 0x78, 0x78, 0x78, 0xff, 0xc8, 0xc8, 0xc8, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||||
|
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||||
|
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||||
|
0xc8, 0xc8, 0xc8, 0xff, 0x00, 0x00, 0x00, 0xff, 0x78, 0x78, 0x78, 0xff, 0xc8, 0xc8, 0xc8, 0xff,
|
||||||
|
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||||
|
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||||
|
0xff, 0xff, 0xff, 0xff, 0xc8, 0xc8, 0xc8, 0xff, 0x00, 0x00, 0x00, 0xff, 0x78, 0x78, 0x78, 0xff,
|
||||||
|
0xc8, 0xc8, 0xc8, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||||
|
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||||
|
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc8, 0xc8, 0xc8, 0xff, 0x00, 0x00, 0x00, 0xff,
|
||||||
|
0x78, 0x78, 0x78, 0xff, 0xc8, 0xc8, 0xc8, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||||
|
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||||
|
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc8, 0xc8, 0xc8, 0xff,
|
||||||
|
0x00, 0x00, 0x00, 0xff, 0x78, 0x78, 0x78, 0xff, 0xc8, 0xc8, 0xc8, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||||
|
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||||
|
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||||
|
0xc8, 0xc8, 0xc8, 0xff, 0x00, 0x00, 0x00, 0xff, 0x78, 0x78, 0x78, 0xff, 0xc8, 0xc8, 0xc8, 0xff,
|
||||||
|
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||||
|
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||||
|
0xff, 0xff, 0xff, 0xff, 0xc8, 0xc8, 0xc8, 0xff, 0x00, 0x00, 0x00, 0xff, 0x78, 0x78, 0x78, 0xff,
|
||||||
|
0xc8, 0xc8, 0xc8, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||||
|
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||||
|
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc8, 0xc8, 0xc8, 0xff, 0x00, 0x00, 0x00, 0xff,
|
||||||
|
0x78, 0x78, 0x78, 0xff, 0xc8, 0xc8, 0xc8, 0xff, 0xc8, 0xc8, 0xc8, 0xff, 0xc8, 0xc8, 0xc8, 0xff,
|
||||||
|
0xc8, 0xc8, 0xc8, 0xff, 0xc8, 0xc8, 0xc8, 0xff, 0xc8, 0xc8, 0xc8, 0xff, 0xc8, 0xc8, 0xc8, 0xff,
|
||||||
|
0xc8, 0xc8, 0xc8, 0xff, 0xc8, 0xc8, 0xc8, 0xff, 0xc8, 0xc8, 0xc8, 0xff, 0xc8, 0xc8, 0xc8, 0xff,
|
||||||
|
0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff,
|
||||||
|
0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff,
|
||||||
|
0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff,
|
||||||
|
0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff
|
||||||
|
};
|
||||||
|
|
||||||
Reference in New Issue
Block a user