Fixed some bugs in StealFocus, RemoveFocus and SetStickyMode

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17614 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stefano Ceccherini
2006-05-28 08:50:52 +00:00
parent cd39decc44
commit c1dd282b9b
2 changed files with 19 additions and 13 deletions
+11 -9
View File
@@ -1931,15 +1931,17 @@ BMenu::SetIgnoreHidden(bool on)
void
BMenu::SetStickyMode(bool on)
{
fStickyMode = on;
// TODO: Ugly hack, but it needs to be done right here in this method
BMenuBar *menuBar = dynamic_cast<BMenuBar *>(this);
if (on && menuBar != NULL && menuBar->LockLooper()) {
// Steal the focus from the current focus view
// (needed to handle keyboard navigation)
menuBar->StealFocus();
menuBar->UnlockLooper();
if (fStickyMode != on) {
// TODO: Ugly hack, but it needs to be done right here in this method
BMenuBar *menuBar = dynamic_cast<BMenuBar *>(this);
if (on && menuBar != NULL && menuBar->LockLooper()) {
// Steal the focus from the current focus view
// (needed to handle keyboard navigation)
menuBar->StealFocus();
menuBar->UnlockLooper();
}
fStickyMode = on;
}
// If we are switching to sticky mode, propagate the status