Cache the lastMousedOverItem before showing tooltip.
Optimization, only update the tooltip if not the same as the cached last moused over item. That way the same application name won't keep getting set over and over again.
This commit is contained in:
parent
1f0c9f183e
commit
f73d1f4f28
@ -395,12 +395,18 @@ TExpandoMenuBar::MouseMoved(BPoint where, uint32 code, const BMessage* message)
|
||||
_FinishedDrag();
|
||||
|
||||
if (code == B_INSIDE_VIEW) {
|
||||
// set the tooltip
|
||||
TTeamMenuItem* item = TeamItemAtPoint(where);
|
||||
if (item != NULL && !item->DrawLabel() && item->Name() != '\0')
|
||||
SetToolTip(item->Name());
|
||||
|
||||
if (item != NULL) {
|
||||
if (!item->DrawLabel() && item != fLastMousedOverItem) {
|
||||
// set the tooltip
|
||||
SetToolTip(item->Name());
|
||||
} else
|
||||
fLastMousedOverItem = item;
|
||||
}
|
||||
}
|
||||
|
||||
fLastMousedOverItem = NULL;
|
||||
BMenuBar::MouseMoved(where, code, message);
|
||||
return;
|
||||
}
|
||||
|
@ -109,6 +109,7 @@ class TExpandoMenuBar : public BMenuBar {
|
||||
TTeamMenuItem* fSeparatorItem;
|
||||
TTeamMenuItem* fPreviousDragTargetItem;
|
||||
|
||||
TTeamMenuItem* fLastMousedOverItem;
|
||||
BMenuItem* fLastClickItem;
|
||||
|
||||
static bool sDoMonitor;
|
||||
|
Loading…
Reference in New Issue
Block a user