mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-17 17:39:20 +02:00
LCL: Improved painting of the clNone color icon in TColorBox. Issue #26707, patch from wp.
git-svn-id: trunk@46191 -
This commit is contained in:
parent
9102f248ea
commit
94f04cc3f2
@ -545,6 +545,7 @@ procedure TCustomColorBox.DrawItem(Index: Integer; Rect: TRect; State: TOwnerDra
|
|||||||
var
|
var
|
||||||
r: TRect;
|
r: TRect;
|
||||||
BrushColor, PenColor, NewColor: TColor;
|
BrushColor, PenColor, NewColor: TColor;
|
||||||
|
noFill: Boolean;
|
||||||
begin
|
begin
|
||||||
if Index = -1 then
|
if Index = -1 then
|
||||||
Exit;
|
Exit;
|
||||||
@ -555,6 +556,8 @@ begin
|
|||||||
r.right := r.left + FColorRectWidth;
|
r.right := r.left + FColorRectWidth;
|
||||||
Exclude(State, odPainted);
|
Exclude(State, odPainted);
|
||||||
|
|
||||||
|
noFill := false;
|
||||||
|
|
||||||
with Canvas do
|
with Canvas do
|
||||||
begin
|
begin
|
||||||
FillRect(Rect);
|
FillRect(Rect);
|
||||||
@ -565,7 +568,10 @@ begin
|
|||||||
NewColor := Self.Colors[Index];
|
NewColor := Self.Colors[Index];
|
||||||
|
|
||||||
if NewColor = clNone then
|
if NewColor = clNone then
|
||||||
NewColor := NoneColorColor
|
begin
|
||||||
|
NewColor := NoneColorColor;
|
||||||
|
noFill := true;
|
||||||
|
end
|
||||||
else
|
else
|
||||||
if NewColor = clDefault then
|
if NewColor = clDefault then
|
||||||
NewColor := DefaultColorColor;
|
NewColor := DefaultColorColor;
|
||||||
@ -573,7 +579,14 @@ begin
|
|||||||
Brush.Color := NewColor;
|
Brush.Color := NewColor;
|
||||||
Pen.Color := clBlack;
|
Pen.Color := clBlack;
|
||||||
|
|
||||||
Rectangle(BidiFlipRect(r, Rect, UseRightToLeftAlignment));
|
r := BiDiFlipRect(r, Rect, UseRightToLeftAlignment);
|
||||||
|
Rectangle(r);
|
||||||
|
|
||||||
|
if noFill then
|
||||||
|
begin
|
||||||
|
Line(r.Left, r.Top, r.Right-1, r.Bottom-1);
|
||||||
|
Line(r.Left, r.Bottom-1, r.Right-1, r.Top);
|
||||||
|
end;
|
||||||
|
|
||||||
Brush.Color := BrushColor;
|
Brush.Color := BrushColor;
|
||||||
Pen.Color := PenColor;
|
Pen.Color := PenColor;
|
||||||
|
Loading…
Reference in New Issue
Block a user