From 0fc938717d207bf8050aaac31daf2a5f35dd5339 Mon Sep 17 00:00:00 2001 From: wp_xxyyzz Date: Wed, 20 Jul 2016 16:43:27 +0000 Subject: [PATCH] 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 --- components/tvplanit/source/vpedshape.pas | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/components/tvplanit/source/vpedshape.pas b/components/tvplanit/source/vpedshape.pas index a7dbff0ce..4cf4faa43 100644 --- a/components/tvplanit/source/vpedshape.pas +++ b/components/tvplanit/source/vpedshape.pas @@ -457,7 +457,6 @@ begin Unused(Control, State); Item := cbBrushStyle.Items[Index]; - x := Rect.Left + HeightOf(Rect); with cbBrushStyle.Canvas do try { keep old settings } @@ -467,7 +466,13 @@ begin R := Rect; InflateRect(R, -1, -1); + x := Rect.Left + HeightOf(Rect); 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)); { draw background } @@ -519,7 +524,7 @@ var SavePenColor, SaveBrushColor: TColor; SavePenStyle: TPenStyle; Item: string; - TxtRect : TRect; + R, TxtRect : TRect; x, y: Integer; begin Unused(Control, State); @@ -541,15 +546,20 @@ begin { Set up for drawing sample } Brush.Color := cbPenStyle.Brush.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 } Pen.Style := TPenStyle(GetEnumValue(TypeInfo(TPenStyle), Item)); Pen.Color := cbPenStyle.Font.Color; - MoveTo(Rect.Left + 1, y); + MoveTo(R.Left + 1, y); LineTo(x - 1, y); - MoveTo(Rect.Left + 1, y + 1); + MoveTo(R.Left + 1, y + 1); LineTo(x - 1, y + 1); { Draw the item text }