diff --git a/src/apps/deskbar/ExpandoMenuBar.cpp b/src/apps/deskbar/ExpandoMenuBar.cpp index 390c4e69eb..2dfe039447 100644 --- a/src/apps/deskbar/ExpandoMenuBar.cpp +++ b/src/apps/deskbar/ExpandoMenuBar.cpp @@ -400,24 +400,26 @@ TExpandoMenuBar::MouseMoved(BPoint where, uint32 code, const BMessage* message) case B_INSIDE_VIEW: { TTeamMenuItem* item = TeamItemAtPoint(where); - if (item == NULL) { - // item is NULL, break out - fLastMousedOverItem = NULL; - break; - } - - if (item->HasLabel()) { - // item has a visible label, set the item and break out - fLastMousedOverItem = item; - break; - } - if (item == fLastMousedOverItem) { // already set the tooltip for this item, break out break; } - // new item, update the tooltip with the item name + if (item == NULL) { + // item is NULL, remove the tooltip and break out + fLastMousedOverItem = NULL; + SetToolTip((const char*)NULL); + break; + } + + if (item->HasLabel()) { + // item has a visible label, remove the tooltip and break out + fLastMousedOverItem = item; + SetToolTip((const char*)NULL); + break; + } + + // new item, set the tooltip to the item name SetToolTip(item->Name()); // save the current item for the next MouseMoved() call @@ -425,11 +427,6 @@ TExpandoMenuBar::MouseMoved(BPoint where, uint32 code, const BMessage* message) break; } - - case B_OUTSIDE_VIEW: - case B_EXITED_VIEW: - fLastMousedOverItem = NULL; - break; } BMenuBar::MouseMoved(where, code, message); diff --git a/src/kits/interface/View.cpp b/src/kits/interface/View.cpp index 4d34a389be..80ec21d191 100644 --- a/src/kits/interface/View.cpp +++ b/src/kits/interface/View.cpp @@ -4817,9 +4817,6 @@ BView::DoLayout() void BView::SetToolTip(const char* text) { - if (text == NULL || text[0] == '\0') - return; - if (BTextToolTip* tip = dynamic_cast(fToolTip)) tip->SetText(text); else @@ -4854,6 +4851,13 @@ BView::ShowToolTip(BToolTip* tip) if (tip == NULL) return; + if (BTextToolTip* textTip = dynamic_cast(tip)) { + const char* text = textTip->Text(); + // if text is NULL or blank don't show the tooltip + if (text == NULL || text[0] == '\0') + return; + } + BPoint where; GetMouse(&where, NULL, false);