Browse Source

More logical (and optimal) condition order

(cherry picked from commit 40c6ed8fe5e12fbe2b136cbd8843d62de57b2b83)

Source commit: 16506eb176f3b5b8d25abd5e09243416c2453237
Martin Prikryl 5 years ago
parent
commit
2b9396170b
1 changed files with 4 additions and 4 deletions
  1. 4 4
      source/packages/filemng/CustomDirView.pas

+ 4 - 4
source/packages/filemng/CustomDirView.pas

@@ -922,11 +922,11 @@ end;
 procedure TCustomDirView.WMNotify(var Msg: TWMNotify);
 begin
   // This all is to make header text white in dark mode.
-  if DarkMode and SupportsDarkMode and
-     GetSysDarkTheme and // When system app theme is light, headers are not dark
-     (FHeaderHandle <> 0) and (Msg.NMHdr^.hWndFrom = FHeaderHandle) then
+  if Msg.NMHdr.code = NM_CUSTOMDRAW then
   begin
-    if Msg.NMHdr.code = NM_CUSTOMDRAW then
+    if DarkMode and SupportsDarkMode and
+       GetSysDarkTheme and // When system app theme is light, headers are not dark
+       (FHeaderHandle <> 0) and (Msg.NMHdr^.hWndFrom = FHeaderHandle) then
     begin
       with PNMLVCustomDraw(Msg.NMHdr)^ do
       begin