LCL: LCLGlyphs: Suffix100Scale

git-svn-id: trunk@57856 -
This commit is contained in:
ondrej 2018-05-08 23:02:58 +00:00
parent affd6f7828
commit 56ba252d91
3 changed files with 15 additions and 2 deletions

View File

@ -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

View File

@ -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;

View File

@ -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