[haiku-webkit-commits] r484 - in webkit/trunk/WebKit/haiku/WebPositive: . support

  • From: webkit@xxxxxxxxxxxxxxx
  • To: haiku-webkit-commits@xxxxxxxxxxxxx
  • Date: Tue, 04 May 2010 19:34:13 +0000

Author: stippi
Date: Tue May  4 19:34:13 2010
New Revision: 484
URL: http://mmlr.dyndns.org/changeset/484

Log:
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.

Added:
   webkit/trunk/WebKit/haiku/WebPositive/support/WindowIcon.h
Modified:
   webkit/trunk/WebKit/haiku/WebPositive/BrowserWindow.cpp
   webkit/trunk/WebKit/haiku/WebPositive/BrowserWindow.h
   webkit/trunk/WebKit/haiku/WebPositive/support/BitmapButton.cpp

Modified: webkit/trunk/WebKit/haiku/WebPositive/BrowserWindow.cpp
==============================================================================
--- webkit/trunk/WebKit/haiku/WebPositive/BrowserWindow.cpp     Tue May  4 
16:10:39 2010        (r483)
+++ webkit/trunk/WebKit/haiku/WebPositive/BrowserWindow.cpp     Tue May  4 
19:34:13 2010        (r484)
@@ -35,6 +35,7 @@
 
 #include "AuthenticationPanel.h"
 #include "BaseURL.h"
+#include "BitmapButton.h"
 #include "BrowserApp.h"
 #include "BrowsingHistory.h"
 #include "CredentialsStorage.h"
@@ -47,6 +48,7 @@
 #include "WebPage.h"
 #include "WebView.h"
 #include "WebViewConstants.h"
+#include "WindowIcon.h"
 #include <Alert.h>
 #include <Application.h>
 #include <Bitmap.h>
@@ -376,10 +378,18 @@
                .SetInsets(kInsetSpacing, 0, kInsetSpacing, 0)
        ;
 
+       BitmapButton* toggleFullscreenButton = new BitmapButton(kWindowIconBits,
+               kWindowIconWidth, kWindowIconHeight, kWindowIconFormat,
+               new BMessage(TOGGLE_FULLSCREEN));
+       
toggleFullscreenButton->SetBackgroundMode(BitmapButton::MENUBAR_BACKGROUND);
+
        // Layout
        AddChild(BGroupLayoutBuilder(B_VERTICAL)
 #if !INTEGRATE_MENU_INTO_TAB_BAR
-               .Add(mainMenu)
+               .Add(BGroupLayoutBuilder(B_HORIZONTAL)
+                       .Add(mainMenu)
+                       .Add(toggleFullscreenButton, 0.0f)
+               )
 #endif
                .Add(fTabManager->TabGroup())
                .Add(navigationGroup)
@@ -400,10 +410,12 @@
        fNavigationGroup = layoutItemFor(navigationGroup);
        fFindGroup = layoutItemFor(findGroup);
        fStatusGroup = layoutItemFor(statusGroup);
-
-       CreateNewTab(url, true, webView);
+       fToggleFullscreenButton = layoutItemFor(toggleFullscreenButton);
 
        fFindGroup->SetVisible(false);
+       fToggleFullscreenButton->SetVisible(false);
+
+       CreateNewTab(url, true, webView);
 
        if (toolbarPolicy == DoNotHaveToolbar) {
 #if !INTEGRATE_MENU_INTO_TAB_BAR
@@ -1750,6 +1762,7 @@
        }
        fIsFullscreen = !fIsFullscreen;
        fFullscreenItem->SetMarked(fIsFullscreen);
+       fToggleFullscreenButton->SetVisible(fIsFullscreen);
 }
 
 

Modified: webkit/trunk/WebKit/haiku/WebPositive/BrowserWindow.h
==============================================================================
--- webkit/trunk/WebKit/haiku/WebPositive/BrowserWindow.h       Tue May  4 
16:10:39 2010        (r483)
+++ webkit/trunk/WebKit/haiku/WebPositive/BrowserWindow.h       Tue May  4 
19:34:13 2010        (r484)
@@ -199,6 +199,7 @@
                        BLayoutItem*            fNavigationGroup;
                        BLayoutItem*            fFindGroup;
                        BLayoutItem*            fStatusGroup;
+                       BLayoutItem*            fToggleFullscreenButton;
 
                        BTextControl*           fFindTextControl;
                        BCheckBox*                      
fFindCaseSensitiveCheckBox;

Modified: webkit/trunk/WebKit/haiku/WebPositive/support/BitmapButton.cpp
==============================================================================
--- webkit/trunk/WebKit/haiku/WebPositive/support/BitmapButton.cpp      Tue May 
 4 16:10:39 2010        (r483)
+++ webkit/trunk/WebKit/haiku/WebPositive/support/BitmapButton.cpp      Tue May 
 4 19:34:13 2010        (r484)
@@ -80,6 +80,9 @@
                be_control_look->DrawButtonBackground(this, bounds, updateRect, 
base,
                        flags);
        } else {
+               SetHighColor(tint_color(base, B_DARKEN_2_TINT));
+               StrokeLine(bounds.LeftBottom(), bounds.RightBottom());
+               bounds.bottom--;
                be_control_look->DrawMenuBarBackground(this, bounds, 
updateRect, base,
                        flags);
        }

Added: webkit/trunk/WebKit/haiku/WebPositive/support/WindowIcon.h
==============================================================================
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ webkit/trunk/WebKit/haiku/WebPositive/support/WindowIcon.h  Tue May  4 
19:34:13 2010        (r484)
@@ -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
+};
+

Other related posts:

  • » [haiku-webkit-commits] r484 - in webkit/trunk/WebKit/haiku/WebPositive: . support - webkit