mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-09 08:29:06 +02:00
lcl, win32: create right color brush when color = clDefault
git-svn-id: trunk@28139 -
This commit is contained in:
parent
f77062d277
commit
ef89f04c0a
@ -4621,13 +4621,17 @@ begin
|
||||
if Value=Color then exit;
|
||||
inherited SetColor(Value);
|
||||
if BrushCreated then
|
||||
FBrush.Color := Color;
|
||||
if Color = clDefault then
|
||||
FBrush.Color := TWSWinControlClass(WidgetSetClass).GetDefaultColor(Self)
|
||||
else
|
||||
FBrush.Color := Color;
|
||||
if HandleAllocated and ([csLoading,csDestroying]*ComponentState=[]) then
|
||||
begin
|
||||
TWSWinControlClass(WidgetSetClass).SetColor(Self);
|
||||
Exclude(FWinControlFlags,wcfColorChanged);
|
||||
end else
|
||||
Include(FWinControlFlags,wcfColorChanged);
|
||||
Exclude(FWinControlFlags, wcfColorChanged);
|
||||
end
|
||||
else
|
||||
Include(FWinControlFlags, wcfColorChanged);
|
||||
NotifyControls(CM_PARENTCOLORCHANGED);
|
||||
end;
|
||||
|
||||
@ -4818,7 +4822,10 @@ procedure TWinControl.CreateBrush;
|
||||
begin
|
||||
if BrushCreated then exit;
|
||||
FBrush := TBrush.Create;
|
||||
FBrush.Color := Color;
|
||||
if Color = clDefault then
|
||||
FBrush.Color := TWSWinControlClass(WidgetSetClass).GetDefaultColor(Self)
|
||||
else
|
||||
FBrush.Color := Color;
|
||||
// ToDo: ParentColor
|
||||
end;
|
||||
|
||||
|
@ -1358,17 +1358,9 @@ begin
|
||||
Windows.SetTextColor(WindowDC, Windows.COLORREF(ColorToRGB(ChildWinControl.Font.Color)));
|
||||
WindowColor := ChildWinControl.Brush.Color;
|
||||
if WindowColor = clDefault then
|
||||
begin
|
||||
WindowColor := TWSWinControlClass(ChildWinControl.WidgetSetClass).GetDefaultColor(ChildWinControl);
|
||||
Windows.SetBkColor(WindowDC, Windows.COLORREF(ColorToRGB(WindowColor)));
|
||||
if IsSysColor(WindowColor) then
|
||||
LMessage.Result := LResult(GetSysColorBrush(SysColorToSysColorIndex(WindowColor)));
|
||||
end
|
||||
else
|
||||
begin
|
||||
Windows.SetBkColor(WindowDC, Windows.COLORREF(ColorToRGB(WindowColor)));
|
||||
LMessage.Result := LResult(ChildWinControl.Brush.Reference.Handle);
|
||||
end;
|
||||
Windows.SetBkColor(WindowDC, Windows.COLORREF(ColorToRGB(WindowColor)));
|
||||
LMessage.Result := LResult(ChildWinControl.Brush.Reference.Handle);
|
||||
//DebugLn(['WindowProc ', ChildWinControl.Name, ' Brush: ', LMessage.Result]);
|
||||
// Override default handling
|
||||
WinProcess := false;
|
||||
|
Loading…
Reference in New Issue
Block a user