comctl32: Fix the tooltips behaviour when TTF_ABSOLUTE isn't specified.
This does not mean to use the current cursor position. Instead, it means that the left hand edge of balloon tips doesn't have to be exactly the co-ordinate passed in (i.e. the stem can be as vertical as possible) and it means non-balloon tips can use smart placement.
This commit is contained in:
parent
5ff8e6d7e1
commit
c6525745f2
|
@ -572,8 +572,6 @@ TOOLTIPS_Show (HWND hwnd, TOOLTIPS_INFO *infoPtr, BOOL track_activate)
|
||||||
TRACE("size %d x %d\n", size.cx, size.cy);
|
TRACE("size %d x %d\n", size.cx, size.cy);
|
||||||
|
|
||||||
if (track_activate)
|
if (track_activate)
|
||||||
{
|
|
||||||
if (toolPtr->uFlags & TTF_ABSOLUTE)
|
|
||||||
{
|
{
|
||||||
rect.left = infoPtr->xTrackPos;
|
rect.left = infoPtr->xTrackPos;
|
||||||
rect.top = infoPtr->yTrackPos;
|
rect.top = infoPtr->yTrackPos;
|
||||||
|
@ -586,39 +584,15 @@ TOOLTIPS_Show (HWND hwnd, TOOLTIPS_INFO *infoPtr, BOOL track_activate)
|
||||||
rect.top -= (size.cy / 2);
|
rect.top -= (size.cy / 2);
|
||||||
}
|
}
|
||||||
infoPtr->bToolBelow = TRUE;
|
infoPtr->bToolBelow = TRUE;
|
||||||
}
|
|
||||||
|
if (!(toolPtr->uFlags & TTF_ABSOLUTE))
|
||||||
|
{
|
||||||
|
if (style & TTS_BALLOON)
|
||||||
|
rect.left -= BALLOON_STEMINDENT;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
RECT rcTool;
|
RECT rcTool;
|
||||||
|
|
||||||
GetCursorPos ((LPPOINT)&rect);
|
|
||||||
if (style & TTS_BALLOON)
|
|
||||||
{
|
|
||||||
ptfx = rect.left;
|
|
||||||
if (rect.top - size.cy >= 0)
|
|
||||||
{
|
|
||||||
rect.top -= size.cy;
|
|
||||||
infoPtr->bToolBelow = FALSE;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
infoPtr->bToolBelow = TRUE;
|
|
||||||
rect.top += 20;
|
|
||||||
}
|
|
||||||
rect.left = max(0, rect.left - BALLOON_STEMINDENT);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
rect.top += 20;
|
|
||||||
infoPtr->bToolBelow = TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (toolPtr->uFlags & TTF_CENTERTIP)
|
|
||||||
{
|
|
||||||
rect.left -= (size.cx / 2);
|
|
||||||
rect.top -= (size.cy / 2);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (toolPtr->uFlags & TTF_IDISHWND)
|
if (toolPtr->uFlags & TTF_IDISHWND)
|
||||||
GetWindowRect ((HWND)toolPtr->uId, &rcTool);
|
GetWindowRect ((HWND)toolPtr->uId, &rcTool);
|
||||||
else
|
else
|
||||||
|
@ -633,6 +607,7 @@ TOOLTIPS_Show (HWND hwnd, TOOLTIPS_INFO *infoPtr, BOOL track_activate)
|
||||||
rect.left = rcTool.right;
|
rect.left = rcTool.right;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (toolPtr->uFlags & TTF_CENTERTIP)
|
if (toolPtr->uFlags & TTF_CENTERTIP)
|
||||||
|
|
Loading…
Reference in New Issue