[haiku-webkit-commits] r526 - webkit/trunk/WebKit/haiku/WebPositive

  • From: webkit@xxxxxxxxxxxxxxx
  • To: haiku-webkit-commits@xxxxxxxxxxxxx
  • Date: Tue, 15 Jun 2010 21:24:07 +0000

Author: stippi
Date: Tue Jun 15 21:24:07 2010
New Revision: 526
URL: http://mmlr.dyndns.org/changeset/526

Log:
Add the static items at Bookmark menu construction, so the shortcuts work even
when the menu has never been opened yet.

Modified:
   webkit/trunk/WebKit/haiku/WebPositive/BrowserWindow.cpp

Modified: webkit/trunk/WebKit/haiku/WebPositive/BrowserWindow.cpp
==============================================================================
--- webkit/trunk/WebKit/haiku/WebPositive/BrowserWindow.cpp     Mon Jun 14 
16:08:02 2010        (r525)
+++ webkit/trunk/WebKit/haiku/WebPositive/BrowserWindow.cpp     Tue Jun 15 
21:24:07 2010        (r526)
@@ -127,6 +127,10 @@
                :
                BNavMenu(title, B_REFS_RECEIVED, target)
        {
+               // Add these items here already, so the shortcuts work even when
+               // the menu has never been opened yet.
+               _AddStaticItems();
+
                SetNavDir(navDir);
        }
 
@@ -137,11 +141,17 @@
                BNavMenu::AttachedToWindow();
                if (CountItems() > 0)
                        AddItem(new BSeparatorItem(), 0);
+               _AddStaticItems();
+               DoLayout();
+       }
+
+private:
+       void _AddStaticItems()
+       {
                AddItem(new BMenuItem("Manage bookmarks",
                        new BMessage(SHOW_BOOKMARKS), 'M'), 0);
                AddItem(new BMenuItem("Bookmark this page",
                        new BMessage(CREATE_BOOKMARK), 'B'), 0);
-               DoLayout();
        }
 };
 

Other related posts:

  • » [haiku-webkit-commits] r526 - webkit/trunk/WebKit/haiku/WebPositive - webkit