mirror of
https://github.com/doublecmd/doublecmd.git
synced 2026-06-21 09:58:13 +00:00
ADD: Load folder system icon under Linux when an absolute icon file name used (fixes #2061)
This commit is contained in:
parent
2c335a3e53
commit
d3a2c1b0d4
1 changed files with 9 additions and 2 deletions
|
|
@ -513,6 +513,7 @@ var
|
|||
AFile: TFile;
|
||||
AIcon: TIcon;
|
||||
iIndex : PtrInt;
|
||||
FileExt: String;
|
||||
GraphicClass: TGraphicClass;
|
||||
bmStandartBitmap : Graphics.TBitMap = nil;
|
||||
begin
|
||||
|
|
@ -554,8 +555,9 @@ begin
|
|||
else
|
||||
{$ENDIF}
|
||||
begin
|
||||
FileExt := ExtractOnlyFileExt(sFileName);
|
||||
// if file is graphic
|
||||
GraphicClass:= GetGraphicClassForFileExtension(ExtractOnlyFileExt(sFileName));
|
||||
GraphicClass:= GetGraphicClassForFileExtension(FileExt);
|
||||
if (GraphicClass <> nil) and mbFileExists(sFileName) then
|
||||
begin
|
||||
if (GraphicClass = TIcon) then
|
||||
|
|
@ -579,6 +581,11 @@ begin
|
|||
end;
|
||||
AIcon.Free;
|
||||
end
|
||||
else if (GraphicClass = TScalableVectorGraphics) then
|
||||
begin
|
||||
Stretch := False;
|
||||
bmStandartBitmap := TScalableVectorGraphics.CreateBitmap(sFileName, iIconSize, iIconSize)
|
||||
end
|
||||
else begin
|
||||
LoadBitmapFromFile(sFileName, bmStandartBitmap);
|
||||
end;
|
||||
|
|
@ -1037,7 +1044,7 @@ begin
|
|||
if Length(AIconName) = 0 then
|
||||
Result:= -1
|
||||
else begin
|
||||
Result:= CheckAddThemePixmap(AIconName);
|
||||
Result:= CheckAddPixmap(AIconName);
|
||||
end;
|
||||
if (Result < 0) and (AIconName <> 'folder') then
|
||||
begin
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue