mirror of
https://github.com/reactos/reactos.git
synced 2024-07-01 10:20:03 +00:00
Set maximum balloon width for notification area
This commit is contained in:
parent
4ba8af9cae
commit
ab1868c7bf
|
@ -21,6 +21,8 @@
|
||||||
|
|
||||||
#include "precomp.h"
|
#include "precomp.h"
|
||||||
|
|
||||||
|
#define BALLOON_MAXWIDTH 340
|
||||||
|
|
||||||
struct InternalIconData : NOTIFYICONDATA
|
struct InternalIconData : NOTIFYICONDATA
|
||||||
{
|
{
|
||||||
// Must keep a separate copy since the original is unioned with uTimeout.
|
// 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
|
// TODO: NIF_REALTIME, NIIF_NOSOUND, other Vista+ flags
|
||||||
|
|
||||||
const int index = IndexOf(info.pSource);
|
m_current = info.pSource;
|
||||||
RECT rc;
|
RECT rc;
|
||||||
m_toolbar->GetItemRect(index, &rc);
|
m_toolbar->GetItemRect(IndexOf(m_current), &rc);
|
||||||
m_toolbar->ClientToScreen(&rc);
|
m_toolbar->ClientToScreen(&rc);
|
||||||
const WORD x = (rc.left + rc.right) / 2;
|
const WORD x = (rc.left + rc.right) / 2;
|
||||||
const WORD y = (rc.top + rc.bottom) / 2;
|
const WORD y = (rc.top + rc.bottom) / 2;
|
||||||
|
|
||||||
m_tooltips->SetTitle(info.szInfoTitle, info.uIcon);
|
m_tooltips->SetTitle(info.szInfoTitle, info.uIcon);
|
||||||
m_tooltips->TrackPosition(x, y);
|
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->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_tooltips->TrackActivate(m_hwndParent, reinterpret_cast<LPARAM>(m_toolbar->m_hWnd));
|
||||||
|
|
||||||
m_current = info.pSource;
|
|
||||||
int timeout = info.uTimeout;
|
int timeout = info.uTimeout;
|
||||||
if (timeout < MinTimeout) timeout = MinTimeout;
|
if (timeout < MinTimeout) timeout = MinTimeout;
|
||||||
if (timeout > MaxTimeout) timeout = MaxTimeout;
|
if (timeout > MaxTimeout) timeout = MaxTimeout;
|
||||||
|
|
Loading…
Reference in a new issue