mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-31 01:31:04 +02:00
LCL: LCLGlyphs: Suffix100Scale
git-svn-id: trunk@57856 -
This commit is contained in:
parent
affd6f7828
commit
56ba252d91
@ -5432,6 +5432,7 @@ begin
|
||||
FSortLCLImages.Width := 8;
|
||||
FSortLCLImages.Height := 8;
|
||||
FSortLCLImages.RegisterResolutions([8, 12, 16]);
|
||||
FSortLCLImages.Suffix100Scale := 16;
|
||||
end;
|
||||
ImgList := FSortLCLImages;
|
||||
case FSortOrder of
|
||||
|
@ -436,6 +436,9 @@ type
|
||||
FIgnoreMissingResources: Boolean;
|
||||
FImageIndexes: TAvgLvlTree;
|
||||
FLoadResolutions: array of Integer;
|
||||
FSuffix100Scale: Integer;
|
||||
|
||||
function RealSuffix100Scale: Integer;
|
||||
public
|
||||
function GetImageIndex(const AResourceName: string): Integer;
|
||||
procedure RegisterResolutions(const AResolutionWidths: array of Integer); override;
|
||||
@ -444,6 +447,7 @@ type
|
||||
destructor Destroy; override;
|
||||
|
||||
property IgnoreMissingResources: Boolean read FIgnoreMissingResources write FIgnoreMissingResources;
|
||||
property Suffix100Scale: Integer read FSuffix100Scale write FSuffix100Scale;
|
||||
end;
|
||||
|
||||
function LCLGlyphs: TLCLGlyphs;
|
||||
|
@ -2737,7 +2737,7 @@ function TLCLGlyphs.GetImageIndex(const AResourceName: string): Integer;
|
||||
var
|
||||
G: TCustomBitmap;
|
||||
begin
|
||||
G := GetDefaultGlyph(AResourceName, MulDiv(ResolutionWidth, 100, 16), False);
|
||||
G := GetDefaultGlyph(AResourceName, MulDiv(ResolutionWidth, 100, RealSuffix100Scale), False);
|
||||
try
|
||||
Result := AddSliceCentered(G);
|
||||
finally
|
||||
@ -2749,7 +2749,7 @@ function TLCLGlyphs.GetImageIndex(const AResourceName: string): Integer;
|
||||
var
|
||||
G: TCustomBitmap;
|
||||
begin
|
||||
G := GetDefaultGlyph(AResourceName, MulDiv(ResolutionWidth, 100, 16), FIgnoreMissingResources);
|
||||
G := GetDefaultGlyph(AResourceName, MulDiv(ResolutionWidth, 100, RealSuffix100Scale), FIgnoreMissingResources);
|
||||
if G<>nil then
|
||||
try
|
||||
ReplaceSliceCentered(ImageIndex, ResolutionWidth, G, False);
|
||||
@ -2782,6 +2782,14 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
function TLCLGlyphs.RealSuffix100Scale: Integer;
|
||||
begin
|
||||
if FSuffix100Scale=0 then
|
||||
Result := Width
|
||||
else
|
||||
Result := FSuffix100Scale;
|
||||
end;
|
||||
|
||||
procedure TLCLGlyphs.RegisterResolutions(
|
||||
const AResolutionWidths: array of Integer);
|
||||
var
|
||||
|
Loading…
Reference in New Issue
Block a user