Commit c6525745 authored by Rob Shearman's avatar Rob Shearman Committed by Alexandre Julliard

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.
parent 5ff8e6d7
......@@ -573,8 +573,6 @@ TOOLTIPS_Show (HWND hwnd, TOOLTIPS_INFO *infoPtr, BOOL track_activate)
if (track_activate)
{
if (toolPtr->uFlags & TTF_ABSOLUTE)
{
rect.left = infoPtr->xTrackPos;
rect.top = infoPtr->yTrackPos;
ptfx = rect.left;
......@@ -586,38 +584,14 @@ TOOLTIPS_Show (HWND hwnd, TOOLTIPS_INFO *infoPtr, BOOL track_activate)
rect.top -= (size.cy / 2);
}
infoPtr->bToolBelow = TRUE;
}
else
{
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
if (!(toolPtr->uFlags & TTF_ABSOLUTE))
{
infoPtr->bToolBelow = TRUE;
rect.top += 20;
}
rect.left = max(0, rect.left - BALLOON_STEMINDENT);
}
if (style & TTS_BALLOON)
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);
}
RECT rcTool;
if (toolPtr->uFlags & TTF_IDISHWND)
GetWindowRect ((HWND)toolPtr->uId, &rcTool);
......@@ -633,6 +607,7 @@ TOOLTIPS_Show (HWND hwnd, TOOLTIPS_INFO *infoPtr, BOOL track_activate)
rect.left = rcTool.right;
}
}
}
else
{
if (toolPtr->uFlags & TTF_CENTERTIP)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment