@@ -144,9 +144,11 @@ procedure Detour_TThemedMenuItem_DrawBackground(Self: TThemedMenuItemClass;var P
144144 if TColorizerLocalSettings.Settings.Enabled and TColorizerLocalSettings.Settings.UseVCLStyles and TColorizerLocalSettings.Settings.VCLStylesMenusColors then
145145 begin
146146 Self.PaintRectHelper := PaintRect;
147- if ColorizerStyleServices.IsSystemStyle then
148- ColorizerStyleServices.DrawElement(Self.Canvas.Handle, StyleServices.GetElementDetails(tmPopupBackground), Self.PaintRectHelper);
149- ColorizerStyleServices.DrawElement(Self.Canvas.Handle, StyleServices.GetElementDetails(tmPopupGutter), Self.GutterRectHelper);
147+ // if ColorizerStyleServices.IsSystemStyle then
148+ // ColorizerStyleServices.DrawElement(Self.Canvas.Handle, StyleServices.GetElementDetails(tmPopupBackground), Self.PaintRectHelper);
149+ // ColorizerStyleServices.DrawElement(Self.Canvas.Handle, StyleServices.GetElementDetails(tmPopupGutter), Self.GutterRectHelper);
150+ // ColorizerStyleServices.DrawElement(Self.Canvas.Handle, ColorizerStyleServices.GetElementDetails(tmPopupBackground), Self.PaintRectHelper);
151+ ColorizerStyleServices.DrawElement(Self.Canvas.Handle, ColorizerStyleServices.GetElementDetails(tmPopupGutter), Self.GutterRectHelper);
150152 end
151153 else
152154 Trampoline_TThemedMenuItem_DrawBackground(Self, PaintRect);
@@ -257,7 +259,7 @@ procedure Detour_TThemedMenuItem_DoDrawText(Self: TThemedMenuItemClass;DC: HDC;
257259 else
258260 if not Self.Enabled then
259261 begin
260- LBackColor:= ColorizerStyleServices.GetSystemColor(clBtnFace);
262+ LBackColor:= TColorizerLocalSettings.ColorMap.MenuColor; // ColorizerStyleServices.GetSystemColor(clBtnFace);
261263 Self.Canvas.Brush.Color := LBackColor;
262264 end ;
263265
@@ -312,23 +314,6 @@ procedure Detour_TThemedPopupMenu_NCPaint(Self: TThemedPopupMenuClass; DC: HDC);
312314 Trampoline_TThemedPopupMenu_NCPaint(Self, DC);
313315end ;
314316
315- // procedure Detour_TWinControl_CreateWnd(Self : TWinControl);
316- // var
317- // AStyle : NativeInt;
318- // begin
319- // Trampoline_TWinControl_CreateWnd(Self);
320- // if TColorizerLocalSettings.Settings.Enabled then
321- // begin
322- // if (Self is TCustomActionPopupMenu) {or (Self is TThemedPopupMenu) or (Self is TXPStylePopupMenu)} then
323- // begin
324- // AStyle := GetWindowLong(Self.Handle, GWL_EXSTYLE);
325- // if (AStyle and WS_EX_LAYERED) = 0 then
326- // SetWindowLong(Self.Handle, GWL_EXSTYLE, AStyle or WS_EX_LAYERED);
327- // SetLayeredWindowAttributes(Self.Handle, 0, 220, LWA_ALPHA);
328- // end;
329- // end;
330- // end;
331-
332317procedure Detour_TCustomActionPopupMenu_CMVisibleChanged (Self : TCustomActionPopupMenuClass;var Message: TMessage);
333318var
334319 AStyle : NativeInt;
@@ -343,18 +328,6 @@ procedure Detour_TCustomActionPopupMenu_CMVisibleChanged(Self : TCustomActionPop
343328 Trampoline_TCustomActionPopupMenu_CMVisibleChanged(Self, Message);
344329end ;
345330
346- // procedure Detour_TCustomActionPopupMenu_CreateParams(Self : TCustomActionPopupMenuClass; var Params: TCreateParams);
347- // begin
348- // if TColorizerLocalSettings.Settings.Enabled and TColorizerLocalSettings.Settings.UseVCLStyles and TColorizerLocalSettings.Settings.VCLStylesMenusColors then
349- // begin
350- // with Params do
351- // if (ExStyle and WS_EX_LAYERED) = 0 then
352- // ExStyle := ExStyle or WS_EX_LAYERED;
353- // end;
354- // Trampoline_TCustomActionPopupMenu_CreateParams(Self, Params);
355- // end;
356-
357-
358331procedure Detour_TCustomActionPopupMenu_DrawBackground (Self : TCustomActionPopupMenuClass);
359332begin
360333 if TColorizerLocalSettings.Settings.Enabled and TColorizerLocalSettings.Settings.UseVCLStyles and TColorizerLocalSettings.Settings.VCLStylesMenusColors then
@@ -546,9 +519,7 @@ procedure InstallThemedActnCtrlsHooks;
546519 Trampoline_TThemedPopupMenu_NCPaint := InterceptCreate(@TThemedPopupMenuClass.NCPaint, @Detour_TThemedPopupMenu_NCPaint);
547520
548521 Trampoline_TCustomActionPopupMenu_DrawBackground := InterceptCreate(@TCustomActionPopupMenuClass.DrawBackground, @Detour_TCustomActionPopupMenu_DrawBackground);
549- // Trampoline_TCustomActionPopupMenu_CreateParams := InterceptCreate(@TCustomActionPopupMenuClass.CreateParams, @Detour_TCustomActionPopupMenu_CreateParams);
550522 Trampoline_TCustomActionPopupMenu_CMVisibleChanged := InterceptCreate(@TCustomActionPopupMenuClass.CMVisibleChanged, @Detour_TCustomActionPopupMenu_CMVisibleChanged);
551- // Trampoline_TWinControl_CreateWnd := InterceptCreate(@TWinControlClass.CreateWnd, @Detour_TWinControl_CreateWnd);
552523
553524 Trampoline_TThemedMenuButton_DoDrawText := InterceptCreate(TThemedMenuButton(nil ).DoDrawTextAddress, @Detour_TThemedMenuButton_DoDrawText);
554525 Trampoline_TThemedMenuButton_DrawBackground := InterceptCreate(@TThemedMenuButtonClass.DrawBackground, @Detour_TThemedMenuButton_DrawBackground);
@@ -557,44 +528,18 @@ procedure InstallThemedActnCtrlsHooks;
557528
558529procedure RemoveThemedActnCtrlsHooks ;
559530begin
560- if Assigned(Trampoline_TThemedMenuItem_DrawBackground) then
561- InterceptRemove(@Trampoline_TThemedMenuItem_DrawBackground);
562-
563- if Assigned(Trampoline_TThemedMenuItem_DrawSeparator) then
564- InterceptRemove(@Trampoline_TThemedMenuItem_DrawSeparator);
565-
566- if Assigned(Trampoline_TThemedMenuItem_DrawSubMenuGlyph) then
567- InterceptRemove(@Trampoline_TThemedMenuItem_DrawSubMenuGlyph);
568-
569- if Assigned(Trampoline_TThemedMenuItem_DrawText) then
570- InterceptRemove(@Trampoline_TThemedMenuItem_DrawText);
571-
572- if Assigned(Trampoline_TThemedMenuItem_DoDrawText) then
573- InterceptRemove(@Trampoline_TThemedMenuItem_DoDrawText);
574-
575- if Assigned(Trampoline_TThemedMenuItem_DoDrawMenuCheck) then
576- InterceptRemove(@Trampoline_TThemedMenuItem_DoDrawMenuCheck);
577-
578- if Assigned(Trampoline_TThemedPopupMenu_NCPaint) then
579- InterceptRemove(@Trampoline_TThemedPopupMenu_NCPaint);
580-
581- if Assigned(Trampoline_TCustomActionPopupMenu_DrawBackground) then
582- InterceptRemove(@Trampoline_TCustomActionPopupMenu_DrawBackground);
583-
584- if Assigned(Trampoline_TCustomActionPopupMenu_CMVisibleChanged) then
585- InterceptRemove(@Trampoline_TCustomActionPopupMenu_CMVisibleChanged);
586-
587- // if Assigned(Trampoline_TWinControl_CreateWnd) then
588- // InterceptRemove(@Trampoline_TWinControl_CreateWnd);
589-
590- if Assigned(Trampoline_TThemedMenuButton_DoDrawText) then
591- InterceptRemove(@Trampoline_TThemedMenuButton_DoDrawText);
592-
593- if Assigned(Trampoline_TThemedMenuButton_DrawBackground) then
594- InterceptRemove(@Trampoline_TThemedMenuButton_DrawBackground);
595-
596- if Assigned(Trampoline_TXPStylePopupMenu_NCPaint) then
597- InterceptRemove(@Trampoline_TXPStylePopupMenu_NCPaint);
531+ InterceptRemove(@Trampoline_TThemedMenuItem_DrawBackground);
532+ InterceptRemove(@Trampoline_TThemedMenuItem_DrawSeparator);
533+ InterceptRemove(@Trampoline_TThemedMenuItem_DrawSubMenuGlyph);
534+ InterceptRemove(@Trampoline_TThemedMenuItem_DrawText);
535+ InterceptRemove(@Trampoline_TThemedMenuItem_DoDrawText);
536+ InterceptRemove(@Trampoline_TThemedMenuItem_DoDrawMenuCheck);
537+ InterceptRemove(@Trampoline_TThemedPopupMenu_NCPaint);
538+ InterceptRemove(@Trampoline_TCustomActionPopupMenu_DrawBackground);
539+ InterceptRemove(@Trampoline_TCustomActionPopupMenu_CMVisibleChanged);
540+ InterceptRemove(@Trampoline_TThemedMenuButton_DoDrawText);
541+ InterceptRemove(@Trampoline_TThemedMenuButton_DrawBackground);
542+ InterceptRemove(@Trampoline_TXPStylePopupMenu_NCPaint);
598543end ;
599544
600545end .
0 commit comments