diff options
Diffstat (limited to 'gui')
-rw-r--r-- | gui/style.inc | 7 | ||||
-rw-r--r-- | gui/stylemanager.pas | 17 |
2 files changed, 20 insertions, 4 deletions
diff --git a/gui/style.inc b/gui/style.inc index c8700536..e66469f3 100644 --- a/gui/style.inc +++ b/gui/style.inc @@ -308,8 +308,7 @@ begin // Palette := ADisplay.DefaultScreen.CreatePalette(8, @PalData); - {$Note All data image formats was PixelFormatPal4, is 8bit going to work? } - Image := TFBitmap.Create(60, 12, PixelFormatPal8); + Image := TFBitmap.Create(60, 12, PixelFormatPal4); Image.Palette := Palette; Image.SetPixelsFromData(@RadioBitmapData, 30); ImageCanvas.DrawImage(Image, Point(0, 0)); @@ -320,13 +319,13 @@ begin MaskCanvas.DrawImage(Image, Point(0, 0)); Image.Free; - Image := TFBitmap.Create(66, 13, PixelFormatPal8); {!!!: width is 65, but fpGFX emulayer has a problem with odd widths} + Image := TFBitmap.Create(66, 13, PixelFormatPal4); {!!!: width is 65, but fpGFX emulayer has a problem with odd widths} Image.Palette := Palette; Image.SetPixelsFromData(@CheckBoxBitmapData, 33); ImageCanvas.DrawImage(Image, Point(0, 12)); Image.Free; - Image := TFBitmap.Create(64, 8, PixelFormatPal8); + Image := TFBitmap.Create(64, 8, PixelFormatPal4); Image.Palette := Palette; Image.SetPixelsFromData(@ArrowBitmapData, 32); ImageCanvas.DrawImage(Image, Point(0, 25)); diff --git a/gui/stylemanager.pas b/gui/stylemanager.pas index fab17479..c128d7d3 100644 --- a/gui/stylemanager.pas +++ b/gui/stylemanager.pas @@ -32,6 +32,8 @@ type FUserStyle: TStyle; function GetDefaultStyle: TStyle; public + constructor Create; + destructor Destroy;override; property DefaultStyle: TStyle read GetDefaultStyle; procedure SetStyle(pNewStyle: TStyle); end; @@ -72,6 +74,21 @@ begin end; end; +constructor TStyleManager.Create; +begin + FUserStyle := nil; + FDefaultStyle := nil; +end; + +destructor TStyleManager.Destroy; +begin + if FUserStyle <> nil then + FUserStyle.Free; + if FDefaultStyle <> nil then + FDefaultStyle.Free; + inherited Destroy; +end; + procedure TStyleManager.SetStyle(pNewStyle: TStyle); begin if Assigned(FUserStyle) then |