From fdd4f3bbb8025e3ace4756b836969a516267515e Mon Sep 17 00:00:00 2001 From: stippi Date: Tue, 15 Jun 2010 21:24:07 +0000 Subject: [PATCH] Add the static items at Bookmark menu construction, so the shortcuts work even when the menu has never been opened yet. git-svn-id: http://svn.haiku-os.org/webpositive/webkit/trunk@526 94f232f2-1747-11df-bad5-a5bfde151594 --- src/apps/webpositive/BrowserWindow.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/apps/webpositive/BrowserWindow.cpp b/src/apps/webpositive/BrowserWindow.cpp index dede2493c0..cd02a496a9 100644 --- a/src/apps/webpositive/BrowserWindow.cpp +++ b/src/apps/webpositive/BrowserWindow.cpp @@ -127,6 +127,10 @@ public: : 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 @@ public: 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(); } };