[EXPLORER] Center the text of the clock

CTrayClockWnd: Fix the calculation that centered the text of the clock.
CTrayNotifyWnd: Restore the 1 pixel margin between the clock and the pager.
This commit is contained in:
Giannis Adamopoulos 2018-01-29 21:50:33 +02:00
parent c109dc9f24
commit d11e7af5f2
2 changed files with 2 additions and 5 deletions

View file

@ -534,9 +534,7 @@ LRESULT CTrayClockWnd::OnPaint(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bH
hPrevFont = (HFONT) SelectObject(hDC, hFont);
rcClient.left = (rcClient.right / 2) - (CurrentSize.cx / 2);
rcClient.top = (rcClient.bottom / 2) - (CurrentSize.cy / 2);
rcClient.right = rcClient.left + CurrentSize.cx;
rcClient.bottom = rcClient.top + CurrentSize.cy;
for (i = 0, line = 0;
@ -546,8 +544,7 @@ LRESULT CTrayClockWnd::OnPaint(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bH
if (LineSizes[i].cx != 0)
{
TextOut(hDC,
rcClient.left + (CurrentSize.cx / 2) - (LineSizes[i].cx / 2) +
TRAY_CLOCK_WND_SPACING_X,
(rcClient.right - LineSizes[i].cx) / 2,
rcClient.top + TRAY_CLOCK_WND_SPACING_Y,
szLines[i],
wcslen(szLines[i]));

View file

@ -27,7 +27,7 @@
static const WCHAR szTrayNotifyWndClass [] = TEXT("TrayNotifyWnd");
#define TRAY_NOTIFY_WND_SPACING_X 0
#define TRAY_NOTIFY_WND_SPACING_X 1
#define TRAY_NOTIFY_WND_SPACING_Y 1
class CTrayNotifyWnd :