mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-12-25 06:50:42 +01:00
win32: use cached system brush to draw highlight in the menu instead of creating new brush every time
git-svn-id: trunk@18739 -
This commit is contained in:
parent
675cfef7e7
commit
dc17234e14
@ -536,7 +536,6 @@ var
|
||||
FreeImageList: Boolean;
|
||||
AImageIndex: Integer;
|
||||
ImageRect: TRect;
|
||||
Brush: HBRUSH;
|
||||
begin
|
||||
AImageList := aMenuItem.GetImageList;
|
||||
if AImageList = nil then
|
||||
@ -571,9 +570,9 @@ begin
|
||||
|
||||
if aChecked then // draw rectangle around
|
||||
begin
|
||||
Brush := CreateSolidBrush(GetSysColor(COLOR_HIGHLIGHT));
|
||||
FrameRect(aHDC, Rect(ImageRect.Left - 1, ImageRect.Top - 1, ImageRect.Left + ImageRect.Right + 1, ImageRect.Top + ImageRect.Bottom + 1), Brush);
|
||||
DeleteObject(Brush);
|
||||
FrameRect(aHDC,
|
||||
Rect(ImageRect.Left - 1, ImageRect.Top - 1, ImageRect.Left + ImageRect.Right + 1, ImageRect.Top + ImageRect.Bottom + 1),
|
||||
GetSysColorBrush(COLOR_HIGHLIGHT));
|
||||
end;
|
||||
|
||||
if AImageIndex < AImageList.Count then
|
||||
|
||||
Loading…
Reference in New Issue
Block a user