[EXPLORER][COMCTL32] Fix balloon tooltips and system pager alerts (#5559)

- [EXPLORER] Set maximum balloon width for notification area
- [COMCTL32] Fix balloon tooltip shape

- Limit balloon tooltips from extending past the edges of the monitor, not the edges of the work area.
- Instead of simply repositioning the main rectangle when the balloon is too far towards one edge of the screen,
  try flipping the balloon the other way. This is the same behavior as Windows Server 2003.
- Tweak some values used to draw the balloon tooltips to more closely follow the Windows balloon tooltip style.
- Removing trailing whitespace.
- While the new changes are guarded, consider cancelling our Wine sync for common controls.
  Our common controls are responsible for many graphical issues and lack of features throughout ReactOS.

CORE-19109
This commit is contained in:
Carl J. Bialorucki 2023-08-10 09:21:03 -06:00 committed by Stanislav Motylkov
parent f53be82158
commit 3e46a8673d
2 changed files with 59 additions and 3 deletions

View file

@ -21,6 +21,8 @@
#include "precomp.h"
#define BALLOON_MAXWIDTH 340
struct InternalIconData : NOTIFYICONDATA
{
// Must keep a separate copy since the original is unioned with uTimeout.
@ -617,19 +619,19 @@ void CBalloonQueue::Show(Info& info)
// TODO: NIF_REALTIME, NIIF_NOSOUND, other Vista+ flags
const int index = IndexOf(info.pSource);
m_current = info.pSource;
RECT rc;
m_toolbar->GetItemRect(index, &rc);
m_toolbar->GetItemRect(IndexOf(m_current), &rc);
m_toolbar->ClientToScreen(&rc);
const WORD x = (rc.left + rc.right) / 2;
const WORD y = (rc.top + rc.bottom) / 2;
m_tooltips->SetTitle(info.szInfoTitle, info.uIcon);
m_tooltips->TrackPosition(x, y);
m_tooltips->SetMaxTipWidth(BALLOON_MAXWIDTH);
m_tooltips->UpdateTipText(m_hwndParent, reinterpret_cast<LPARAM>(m_toolbar->m_hWnd), info.szInfo);
m_tooltips->TrackActivate(m_hwndParent, reinterpret_cast<LPARAM>(m_toolbar->m_hWnd));
m_current = info.pSource;
int timeout = info.uTimeout;
if (timeout < MinTimeout) timeout = MinTimeout;
if (timeout > MaxTimeout) timeout = MaxTimeout;