Patch in part by "yourpalal":
* Set the MENU_STATE_CLOSED state upon BMenu initialization. * When drawing the label, use the parent bounds, including item margins to truncate the label, when the parent menu is closed. Thanks a lot for the patch! Changes by myself: * Cache the MenuPrivate instance in BMenuItem::DrawContent(). * Use Window()->UpdateIfNeeded() to animate the flashing invoked menu item, which makes a lot more sense, the comment about it working in BeOS is probably due to item->Select() probably drawing outside of an update cycle. * The trigger invokation in keyboard handling didn't break out of the loop after invoking an item. Probably didn't matter since triggers are hopefully not assigned to more than one menu item. :-) * Use the same trick as BMenuBar to avoid interfering with keyboard navigation in the BMenu::_Track() hook. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35739 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -644,18 +644,17 @@ BMenuBar::_Track(int32* action, int32 startIndex, bool showMenu)
|
||||
window->Unlock();
|
||||
|
||||
if (fState != MENU_STATE_CLOSED) {
|
||||
// if user doesn't move the mouse, loop here,
|
||||
// If user doesn't move the mouse, loop here,
|
||||
// so we don't interfer with keyboard menu navigation
|
||||
BPoint newLocation;
|
||||
uint32 newButtons;
|
||||
BPoint newLocation = where;
|
||||
uint32 newButtons = buttons;
|
||||
do {
|
||||
snooze(snoozeAmount);
|
||||
if (!LockLooper())
|
||||
break;
|
||||
GetMouse(&newLocation, &newButtons, true);
|
||||
UnlockLooper();
|
||||
} while (newLocation == where
|
||||
&& newButtons == buttons);
|
||||
} while (newLocation == where && newButtons == buttons);
|
||||
|
||||
where = newLocation;
|
||||
buttons = newButtons;
|
||||
|
||||
Reference in New Issue
Block a user