Show the full window title in Deskbar in a tooltip
... if it gets truncated in vertical expando mode.
This commit is contained in:
@@ -412,22 +412,38 @@ TExpandoMenuBar::MouseMoved(BPoint where, uint32 code, const BMessage* message)
|
|||||||
case B_ENTERED_VIEW:
|
case B_ENTERED_VIEW:
|
||||||
case B_INSIDE_VIEW:
|
case B_INSIDE_VIEW:
|
||||||
{
|
{
|
||||||
TTeamMenuItem* item = TeamItemAtPoint(where);
|
BMenuItem* menuItem;
|
||||||
if (item == fLastMousedOverItem) {
|
TTeamMenuItem* item = TeamItemAtPoint(where, &menuItem);
|
||||||
// already set the tooltip for this item, break out
|
TWindowMenuItem* windowMenuItem
|
||||||
break;
|
= dynamic_cast<TWindowMenuItem*>(menuItem);
|
||||||
}
|
if (item == NULL || menuItem == NULL) {
|
||||||
|
|
||||||
if (item == NULL) {
|
|
||||||
// item is NULL, remove the tooltip and break out
|
// item is NULL, remove the tooltip and break out
|
||||||
fLastMousedOverItem = NULL;
|
fLastMousedOverItem = NULL;
|
||||||
SetToolTip((const char*)NULL);
|
SetToolTip((const char*)NULL);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (menuItem == fLastMousedOverItem) {
|
||||||
|
// already set the tooltip for this item, break out
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (windowMenuItem != NULL && fBarView->Vertical()
|
||||||
|
&& fBarView->ExpandoState() && item->IsExpanded()) {
|
||||||
|
// expando mode window menu item
|
||||||
|
fLastMousedOverItem = menuItem;
|
||||||
|
if (strcmp(windowMenuItem->Label(),
|
||||||
|
windowMenuItem->FullTitle()) != 0) {
|
||||||
|
// label is truncated, set tooltip
|
||||||
|
SetToolTip(windowMenuItem->FullTitle());
|
||||||
|
} else
|
||||||
|
SetToolTip((const char*)NULL);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
if (item->HasLabel()) {
|
if (item->HasLabel()) {
|
||||||
// item has a visible label, remove the tooltip and break out
|
// item has a visible label, remove the tooltip and break out
|
||||||
fLastMousedOverItem = item;
|
fLastMousedOverItem = menuItem;
|
||||||
SetToolTip((const char*)NULL);
|
SetToolTip((const char*)NULL);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -435,8 +451,8 @@ TExpandoMenuBar::MouseMoved(BPoint where, uint32 code, const BMessage* message)
|
|||||||
// new item, set the tooltip to the item name
|
// new item, set the tooltip to the item name
|
||||||
SetToolTip(item->Name());
|
SetToolTip(item->Name());
|
||||||
|
|
||||||
// save the current item for the next MouseMoved() call
|
// save the current menuitem for the next MouseMoved() call
|
||||||
fLastMousedOverItem = item;
|
fLastMousedOverItem = menuItem;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -107,7 +107,7 @@ class TExpandoMenuBar : public BMenuBar {
|
|||||||
|
|
||||||
TTeamMenuItem* fPreviousDragTargetItem;
|
TTeamMenuItem* fPreviousDragTargetItem;
|
||||||
|
|
||||||
TTeamMenuItem* fLastMousedOverItem;
|
BMenuItem* fLastMousedOverItem;
|
||||||
BMenuItem* fLastClickItem;
|
BMenuItem* fLastClickItem;
|
||||||
|
|
||||||
static bool sDoMonitor;
|
static bool sDoMonitor;
|
||||||
|
|||||||
Reference in New Issue
Block a user