summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--prototypes/fpgui2/tests/themetest.lpr6
-rw-r--r--src/corelib/gfxbase.pas5
-rw-r--r--src/gui/gui_listbox.pas24
3 files changed, 33 insertions, 2 deletions
diff --git a/prototypes/fpgui2/tests/themetest.lpr b/prototypes/fpgui2/tests/themetest.lpr
index 0aa5f251..65b65fc8 100644
--- a/prototypes/fpgui2/tests/themetest.lpr
+++ b/prototypes/fpgui2/tests/themetest.lpr
@@ -461,6 +461,7 @@ var
part: TfpgImage;
r: TRect;
x, y: TfpgCoord;
+ nr: TfpgRect;
begin
Canvas.BeginDraw;
inherited HandlePaint;
@@ -535,6 +536,11 @@ begin
// Canvas.StretchDraw(5, 69, 17, 17, partimg);
img.Free;
+
+ nr.SetRect(20, 250, 100, 4);
+ Canvas.DrawControlFrame(nr);
+ nr.SetRect(70, 241, 11, 21);
+ Canvas.DrawButtonFace(nr, []);
Canvas.EndDraw;
diff --git a/src/corelib/gfxbase.pas b/src/corelib/gfxbase.pas
index 3c5a34c4..8d7f814f 100644
--- a/src/corelib/gfxbase.pas
+++ b/src/corelib/gfxbase.pas
@@ -933,10 +933,11 @@ begin
newcolor.Blue := RGBStart.Blue + (i * BDiff) div count;
SetColor(RGBTripleTofpgColor(newcolor));
+ // We have to overshoot by 1 pixel as DrawLine paints 1 pixel short (by design)
if ADirection = gdHorizontal then
- DrawLine(ARect.Left+i, ARect.Top, ARect.Left+i, ARect.Bottom)
+ DrawLine(ARect.Left+i, ARect.Top, ARect.Left+i, ARect.Bottom+1)
else
- DrawLine(ARect.Left, ARect.Top+i, ARect.Right, ARect.Top+i);
+ DrawLine(ARect.Left, ARect.Top+i, ARect.Right+1, ARect.Top+i);
end;
// Changed;
end;
diff --git a/src/gui/gui_listbox.pas b/src/gui/gui_listbox.pas
index 26f52d9e..825c36de 100644
--- a/src/gui/gui_listbox.pas
+++ b/src/gui/gui_listbox.pas
@@ -500,6 +500,30 @@ begin
end; { if/else }
Canvas.FillRectangle(r);
+ // This is just a test.
+ // BlueCurve theme :)
+ if (n = FFocusItem) and FFocused then
+ begin
+ // outer dark border
+ Canvas.SetColor(TfpgColor($3b4c71));
+ Canvas.SetLineStyle(1, lsSolid);
+ Canvas.DrawRectangle(r);
+ InflateRect(r, -1, -1);
+ // left top
+ Canvas.SetColor(TfpgColor($98b2ed));
+ Canvas.DrawLine(r.Left, r.Bottom, r.Left, r.Top); // left
+ Canvas.DrawLine(r.Left, r.Top, r.Right, r.Top); // top
+ // right bottom
+ Canvas.SetColor(TfpgColor($4468b8));
+ Canvas.DrawLine(r.Right, r.Top, r.Right, r.Bottom); // right
+ Canvas.DrawLine(r.Right, r.Bottom, r.Left-1, r.Bottom); // bottom
+ // inside gradient fill
+ InflateRect(r, -1, -1);
+ Canvas.GradientFill(r, TfpgColor($435e9a), TfpgColor($5476c4), gdVertical);
+ // reset rectangle
+ InflateRect(r, 2, 2);
+ end;
+
DrawItem(n, r, 0);
inc(r.Top, RowHeight);