Author: gadamopoulos
Date: Sat May 27 09:09:01 2017
New Revision: 74677
URL:
http://svn.reactos.org/svn/reactos?rev=74677&view=rev
Log:
[EXPLORER] -Reload the theme data only when the orientation changes (we ended up reloading
it every few seconds).
Modified:
trunk/reactos/base/shell/explorer/trayntfy.cpp
Modified: trunk/reactos/base/shell/explorer/trayntfy.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/explorer/traynt…
==============================================================================
--- trunk/reactos/base/shell/explorer/trayntfy.cpp [iso-8859-1] (original)
+++ trunk/reactos/base/shell/explorer/trayntfy.cpp [iso-8859-1] Sat May 27 09:09:01 2017
@@ -1334,25 +1334,17 @@
m_pager = new CSysPagerWnd();
m_pager->_Init(m_hWnd, !HideClock);
- OnThemeChanged();
-
- return TRUE;
- }
-
- BOOL GetMinimumSize(IN BOOL Horizontal, IN OUT PSIZE pSize)
+ return TRUE;
+ }
+
+ BOOL GetMinimumSize(IN OUT PSIZE pSize)
{
SIZE szClock = { 0, 0 };
SIZE szTray = { 0, 0 };
- IsHorizontal = Horizontal;
- if (IsHorizontal)
- SetWindowTheme(m_hWnd, L"TrayNotifyHoriz", NULL);
- else
- SetWindowTheme(m_hWnd, L"TrayNotifyVert", NULL);
-
if (!HideClock)
{
- if (Horizontal)
+ if (IsHorizontal)
{
szClock.cy = pSize->cy - 2 * TRAY_NOTIFY_WND_SPACING_Y;
if (szClock.cy <= 0)
@@ -1365,7 +1357,7 @@
goto NoClock;
}
- m_clock->SendMessage(TCWM_GETMINIMUMSIZE, (WPARAM) Horizontal, (LPARAM)
&szClock);
+ m_clock->SendMessage(TCWM_GETMINIMUMSIZE, (WPARAM) IsHorizontal, (LPARAM)
&szClock);
szTrayClockMin = szClock;
}
@@ -1373,7 +1365,7 @@
NoClock:
szTrayClockMin = szClock;
- if (Horizontal)
+ if (IsHorizontal)
{
szTray.cy = pSize->cy - 2 * TRAY_NOTIFY_WND_SPACING_Y;
}
@@ -1382,11 +1374,11 @@
szTray.cx = pSize->cx - 2 * TRAY_NOTIFY_WND_SPACING_X;
}
- m_pager->GetSize(Horizontal, &szTray);
+ m_pager->GetSize(IsHorizontal, &szTray);
szTrayNotify = szTray;
- if (Horizontal)
+ if (IsHorizontal)
{
pSize->cx = 2 * TRAY_NOTIFY_WND_SPACING_X;
@@ -1513,7 +1505,18 @@
LRESULT OnGetMinimumSize(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL&
bHandled)
{
- return (LRESULT) GetMinimumSize((BOOL) wParam, (PSIZE) lParam);
+ BOOL Horizontal = (BOOL) wParam;
+
+ if (Horizontal != IsHorizontal)
+ {
+ IsHorizontal = Horizontal;
+ if (IsHorizontal)
+ SetWindowTheme(m_hWnd, L"TrayNotifyHoriz", NULL);
+ else
+ SetWindowTheme(m_hWnd, L"TrayNotifyVert", NULL);
+ }
+
+ return (LRESULT) GetMinimumSize((PSIZE) lParam);
}
LRESULT OnUpdateTime(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)