diff --git a/components/skia/design/README.txt b/components/skia/design/README.txt
new file mode 100644
index 000000000..172a8f527
--- /dev/null
+++ b/components/skia/design/README.txt
@@ -0,0 +1,3 @@
+Skia.LCL.Design.res was created with:
+
+lazarus/tools/lazres Skia.LCL.Design.res icons/*
diff --git a/components/skia/design/Skia.LCL.Design.lpk b/components/skia/design/Skia.LCL.Design.lpk
index a1895ea8a..33f1cb1a1 100644
--- a/components/skia/design/Skia.LCL.Design.lpk
+++ b/components/skia/design/Skia.LCL.Design.lpk
@@ -7,7 +7,7 @@
-
+
@@ -23,9 +23,7 @@
-
-
- -
-
+
diff --git a/components/skia/design/Skia.LCL.Design.pas b/components/skia/design/Skia.LCL.Design.pas
new file mode 100644
index 000000000..012dceade
--- /dev/null
+++ b/components/skia/design/Skia.LCL.Design.pas
@@ -0,0 +1,22 @@
+{ This file was automatically created by Lazarus. Do not edit!
+ This source is only used to compile and install the package.
+ }
+
+unit Skia.LCL.Design;
+
+{$warn 5023 off : no warning about unused units}
+interface
+
+uses
+ SkiaLCLRegister, LazarusPackageIntf;
+
+implementation
+
+procedure Register;
+begin
+ RegisterUnit('SkiaLCLRegister', @SkiaLCLRegister.Register);
+end;
+
+initialization
+ RegisterPackage('Skia.LCL.Design', @Register);
+end.
diff --git a/components/skia/design/Skia.LCL.Design.res b/components/skia/design/Skia.LCL.Design.res
new file mode 100644
index 000000000..e9987b72f
Binary files /dev/null and b/components/skia/design/Skia.LCL.Design.res differ
diff --git a/components/skia/design/SkiaLCLRegister.pas b/components/skia/design/SkiaLCLRegister.pas
index 19bbe7af8..b9c32b09a 100644
--- a/components/skia/design/SkiaLCLRegister.pas
+++ b/components/skia/design/SkiaLCLRegister.pas
@@ -8,12 +8,14 @@ unit SkiaLCLRegister;
interface
uses
- LCL.Skia;
+ LCL.Skia, classes;
procedure Register;
implementation
+{$R Skia.LCL.Design.res}
+
procedure Register;
begin
RegisterComponents('Skia', [TSkPaintBox]);
diff --git a/components/skia/design/icons/tskpaintbox.png b/components/skia/design/icons/tskpaintbox.png
new file mode 100644
index 000000000..3cfbb8163
Binary files /dev/null and b/components/skia/design/icons/tskpaintbox.png differ
diff --git a/components/skia/design/icons/tskpaintbox_150.png b/components/skia/design/icons/tskpaintbox_150.png
new file mode 100644
index 000000000..b35ad5b58
Binary files /dev/null and b/components/skia/design/icons/tskpaintbox_150.png differ
diff --git a/components/skia/design/icons/tskpaintbox_200.png b/components/skia/design/icons/tskpaintbox_200.png
new file mode 100644
index 000000000..192231557
Binary files /dev/null and b/components/skia/design/icons/tskpaintbox_200.png differ
diff --git a/components/skia/src/LCL.Skia.pas b/components/skia/src/LCL.Skia.pas
index ff13c19a6..ecf472aa1 100644
--- a/components/skia/src/LCL.Skia.pas
+++ b/components/skia/src/LCL.Skia.pas
@@ -48,7 +48,6 @@ type
property DrawCacheKind: TSkDrawCacheKind read FDrawCacheKind write SetDrawCacheKind default TSkDrawCacheKind.Raster;
property OnDraw: TSkDrawEvent read FOnDraw write SetOnDraw;
public
- class function GetControlClassDefaultSize: TSize; override;
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
procedure Redraw; virtual;
@@ -60,7 +59,10 @@ type
{ TSkPaintBox }
TSkPaintBox = class(TSkCustomControl)
+ protected
+ class function GetControlClassDefaultSize: TSize; override;
public
+ constructor Create(AOwner: TComponent); override;
property DrawCacheKind;
published
property Align;
@@ -505,12 +507,6 @@ begin
inherited Resize;
end;
-class function TSkCustomControl.GetControlClassDefaultSize: TSize;
-begin
- Result.CX := 50;
- Result.CY := 50;
-end;
-
constructor TSkCustomControl.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
@@ -538,6 +534,22 @@ begin
inherited Invalidate;
end;
+{ TSkPaintBox }
+
+class function TSkPaintBox.GetControlClassDefaultSize: TSize;
+begin
+ Result.CX := 50;
+ Result.CY := 50;
+end;
+
+constructor TSkPaintBox.Create(AOwner: TComponent);
+begin
+ inherited Create(AOwner);
+ ControlStyle := ControlStyle + [csReplicatable];
+ with GetControlClassDefaultSize do
+ SetInitialBounds(0, 0, CX, CY);
+end;
+
{ TSkSvgBrush }
function TSkSvgBrush.GetDOM: ISkSVGDOM;
diff --git a/components/skia/src/skia.lcl.lpk b/components/skia/src/skia.lcl.lpk
index 95dedb5e6..eaa4905f6 100644
--- a/components/skia/src/skia.lcl.lpk
+++ b/components/skia/src/skia.lcl.lpk
@@ -29,6 +29,7 @@
-
+
-