mirror of
https://github.com/doublecmd/doublecmd.git
synced 2026-06-21 09:58:13 +00:00
ADD: GetCustomIcon() in VfsFileSource
This commit is contained in:
parent
a4b91314c4
commit
c63d8cd385
2 changed files with 14 additions and 1 deletions
|
|
@ -8,7 +8,8 @@ uses
|
|||
Classes, SysUtils, uWFXModule,
|
||||
uFileSourceProperty, uFileSourceOperationTypes,
|
||||
uVirtualFileSource, uFileProperty, uFileSource,
|
||||
uFileSourceOperation, uFile;
|
||||
uFileSourceOperation, uFile,
|
||||
Graphics, uPixMapManager;
|
||||
|
||||
type
|
||||
|
||||
|
|
@ -49,6 +50,8 @@ type
|
|||
function CreateListOperation(TargetPath: String): TFileSourceOperation; override;
|
||||
function CreateExecuteOperation(var ExecutableFile: TFile; BasePath, Verb: String): TFileSourceOperation; override;
|
||||
|
||||
function GetCustomIcon(const path: String; const iconSize: Integer): TBitmap; override; overload;
|
||||
|
||||
property VfsFileList: TWFXModuleList read FWFXModuleList;
|
||||
|
||||
end;
|
||||
|
|
@ -124,5 +127,13 @@ begin
|
|||
Result:= TVfsExecuteOperation.Create(TargetFileSource, ExecutableFile, BasePath, Verb);
|
||||
end;
|
||||
|
||||
function TVfsFileSource.GetCustomIcon(const path: String;
|
||||
const iconSize: Integer): TBitmap;
|
||||
begin
|
||||
Result:= nil;
|
||||
if path = GetRootDir(path) then
|
||||
Result:= PixmapManager.LoadIconThemeBitmap( 'drive-virtual', 0 );
|
||||
end;
|
||||
|
||||
end.
|
||||
|
||||
|
|
|
|||
|
|
@ -693,6 +693,8 @@ end;
|
|||
|
||||
function TPixMapManager.LoadIconThemeBitmap(AIconName: String; AIconSize: Integer): Graphics.TBitmap;
|
||||
begin
|
||||
if AIconSize = 0 then AIconSize := gIconsSize;
|
||||
|
||||
FPixmapsLock.Acquire;
|
||||
try
|
||||
Result := LoadIconThemeBitmapLocked(AIconName, AIconSize);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue