mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 01:55:19 +00:00
Set maximum balloon width for notification area
This commit is contained in:
parent
4ba8af9cae
commit
ab1868c7bf
1 changed files with 5 additions and 3 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue