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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user