LCL: Paint a cross mark also in TColorListbox for clNone. Issue #34632, patch from AlexeyT.

git-svn-id: trunk@59807 -
This commit is contained in:
juha 2018-12-12 21:08:39 +00:00
parent e41b09b476
commit 7f45a8a146

View File

@ -615,8 +615,6 @@ begin
r.left := Rect.left + ColorRectOffset;
r.right := r.left + ColorRectWidth;
noFill := false;
if not(odBackgroundPainted in State) then
Canvas.FillRect(Rect);
@ -624,12 +622,9 @@ begin
PenColor := Canvas.Pen.Color;
NewColor := Colors[Index];
if NewColor = clNone then
begin
NewColor := NoneColorColor;
noFill := true;
end
noFill := NewColor = clNone;
if noFill then
NewColor := NoneColorColor
else
if NewColor = clDefault then
NewColor := DefaultColorColor;
@ -960,6 +955,7 @@ procedure TCustomColorListBox.DrawItem(Index: Integer; Rect: TRect; State: TOwne
var
r: TRect;
BrushColor, PenColor, NewColor: TColor;
noFill: boolean;
begin
if Index < 0 then
Exit;
@ -976,8 +972,8 @@ begin
PenColor := Canvas.Pen.Color;
NewColor := Colors[Index];
if NewColor = clNone then
noFill := NewColor = clNone;
if noFill then
NewColor := NoneColorColor
else
if NewColor = clDefault then
@ -988,6 +984,12 @@ begin
Canvas.Rectangle(BidiFlipRect(r, Rect, UseRightToLeftAlignment));
if noFill then
begin
Canvas.Line(r.Left, r.Top, r.Right-1, r.Bottom-1);
Canvas.Line(r.Left, r.Bottom-1, r.Right-1, r.Top);
end;
Canvas.Brush.Color := BrushColor;
Canvas.Pen.Color := PenColor;