tvplanit: Improved drawing of shape editor's pen and brush comboboxes in Linux

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@5011 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2016-07-20 16:43:27 +00:00
parent dbe08a2511
commit 0fc938717d

View File

@ -457,7 +457,6 @@ begin
Unused(Control, State); Unused(Control, State);
Item := cbBrushStyle.Items[Index]; Item := cbBrushStyle.Items[Index];
x := Rect.Left + HeightOf(Rect);
with cbBrushStyle.Canvas do with cbBrushStyle.Canvas do
try try
{ keep old settings } { keep old settings }
@ -467,7 +466,13 @@ begin
R := Rect; R := Rect;
InflateRect(R, -1, -1); InflateRect(R, -1, -1);
x := Rect.Left + HeightOf(Rect);
R.Right := x; R.Right := x;
{$IFDEF LINUX}
InflateRect(R, -2, -2);
x := Rect.Left + HeightOf(Rect);
R.Right := x - 2;
{$ENDIF}
bs := TBrushStyle(GetEnumValue(TypeInfo(TBrushStyle), Item)); bs := TBrushStyle(GetEnumValue(TypeInfo(TBrushStyle), Item));
{ draw background } { draw background }
@ -519,7 +524,7 @@ var
SavePenColor, SaveBrushColor: TColor; SavePenColor, SaveBrushColor: TColor;
SavePenStyle: TPenStyle; SavePenStyle: TPenStyle;
Item: string; Item: string;
TxtRect : TRect; R, TxtRect : TRect;
x, y: Integer; x, y: Integer;
begin begin
Unused(Control, State); Unused(Control, State);
@ -541,15 +546,20 @@ begin
{ Set up for drawing sample } { Set up for drawing sample }
Brush.Color := cbPenStyle.Brush.Color; Brush.Color := cbPenStyle.Brush.Color;
Pen.Color := cbPenStyle.Font.Color; Pen.Color := cbPenStyle.Font.Color;
Rectangle(Rect.Left + 1, Rect.Top + 1, x - 1, Rect.Bottom - 1); R := Rect;
InflateRect(R, -1, -1);
{$IFDEF LINUX}
InflateRect(R, -2, -2);
{$ENDIF}
Rectangle(R.Left, R.Top, x - 1, R.Bottom);
{ Draw sample } { Draw sample }
Pen.Style := TPenStyle(GetEnumValue(TypeInfo(TPenStyle), Item)); Pen.Style := TPenStyle(GetEnumValue(TypeInfo(TPenStyle), Item));
Pen.Color := cbPenStyle.Font.Color; Pen.Color := cbPenStyle.Font.Color;
MoveTo(Rect.Left + 1, y); MoveTo(R.Left + 1, y);
LineTo(x - 1, y); LineTo(x - 1, y);
MoveTo(Rect.Left + 1, y + 1); MoveTo(R.Left + 1, y + 1);
LineTo(x - 1, y + 1); LineTo(x - 1, y + 1);
{ Draw the item text } { Draw the item text }