ADD: Display RabbitVCS and GVfs emblems when overlay icons enabled

(cherry picked from commit 4178f6e58f)
This commit is contained in:
Alexander Koblov 2026-05-30 13:31:38 +03:00
commit 41e767bf3b
5 changed files with 36 additions and 22 deletions

View file

@ -174,6 +174,11 @@ end;
if (LCLWidgetType = 'gtk2') and (SrcOS = 'unix') and (TargetOS <> 'darwin') then
begin
UnitPath += 'platform/$(SrcOS)/$(LCLWidgetType);';
end;
if (SrcOS = 'unix') and (TargetOS <> 'darwin') and (TargetOS <> 'haiku') then
begin
CustomOptions += '-dXDG -dRabbitVCS';
end;"/>
<Parsing>
<SyntaxOptions>
@ -1462,6 +1467,7 @@ end;"/>
<Unit183>
<Filename Value="filesources\wfxplugin\uwfxplugindeleteoperation.pas"/>
<IsPartOfProject Value="True"/>
<UnitName Value="uWfxPluginDeleteOperation"/>
</Unit183>
<Unit184>
<Filename Value="filesources\wfxplugin\uwfxpluginexecuteoperation.pas"/>
@ -2203,6 +2209,11 @@ end;
if (LCLWidgetType = &apos;qt6&apos;) and (TargetOS &lt;> &apos;darwin&apos;) then
begin
UnitPath += &apos;platform/$(SrcOS)/qt6;platform/$(SrcOS)/wayland;&apos;;
end;
if (SrcOS = &apos;unix&apos;) and (TargetOS &lt;> &apos;darwin&apos;) and (TargetOS &lt;> &apos;haiku&apos;) then
begin
CustomOptions += &apos;-dXDG -dRabbitVCS&apos;;
end;"/>
<Parsing>
<SyntaxOptions>

View file

@ -958,7 +958,7 @@ begin
gShowIcons,
not gIconOverlays);
{$IF DEFINED(MSWINDOWS) OR DEFINED(RabbitVCS)}
{$IF DEFINED(MSWINDOWS) OR DEFINED(RabbitVCS) OR DEFINED(XDG)}
if gIconOverlays and (FWorkingFile.IconOverlayID < 0) then
FWorkingFile.IconOverlayID := PixMapManager.GetIconOverlayByFile(
FWorkingFile.FSFile,

View file

@ -473,7 +473,7 @@ begin
begin
AFile.IconID := PixMapManager.GetIconByFile(AFileSource, AFile, DirectAccess, True, gShowIcons, not gIconOverlays);
end;
{$IF DEFINED(MSWINDOWS) OR DEFINED(RabbitVCS)}
{$IF DEFINED(MSWINDOWS) OR DEFINED(RabbitVCS) OR DEFINED(XDG)}
if gIconOverlays and (AFile.IconOverlayID < 0) then
begin
AFile.IconOverlayID := PixMapManager.GetIconOverlayByFile(AFile.FSFile, DirectAccess);
@ -499,7 +499,7 @@ begin
(AFileSource.CanRetrieveProperties(AFile.FSFile, AFilePropertiesNeeded) or
(AFile.TextColor = clNone) or
(HaveIcons and ( ((AFile.IconID < 0) and (AFile.Icon = nil))
{$IF DEFINED(MSWINDOWS) OR DEFINED(RabbitVCS)}
{$IF DEFINED(MSWINDOWS) OR DEFINED(RabbitVCS) OR DEFINED(XDG)}
or (gIconOverlays and (AFile.IconOverlayID < 0))
{$ENDIF}
))) then

View file

@ -342,7 +342,7 @@ type
IconsMode: TShowIconsMode; GetIconWithLink: Boolean): PtrInt;
function GetIconByFile(constref AFileSource: IFileSource; AFile: TDisplayFile; DirectAccess: Boolean; LoadIcon: Boolean;
IconsMode: TShowIconsMode; GetIconWithLink: Boolean): PtrInt; overload;
{$IF DEFINED(MSWINDOWS) OR DEFINED(RabbitVCS)}
{$IF DEFINED(MSWINDOWS) OR DEFINED(RabbitVCS) OR DEFINED(XDG)}
{en
Retrieves overlay icon index for a file.
@ -423,7 +423,7 @@ type
TBitmap = Graphics.TBitmap;
{$ENDIF}
{$IF DEFINED(MSWINDOWS) OR DEFINED(RabbitVCS)}
{$IF DEFINED(MSWINDOWS)}
const
SystemIconIndexStart: PtrInt = High(PtrInt) div 2;
{$ENDIF}
@ -2247,25 +2247,23 @@ begin
Result:= DrawBitmap(FiEmblemUnreadableID, Canvas, X + I, Y + I, I, I);
end;
end
{$IF DEFINED(MSWINDOWS) OR DEFINED(RabbitVCS)}
{$IF DEFINED(MSWINDOWS) OR DEFINED(RabbitVCS) OR DEFINED(XDG)}
else if gIconOverlays then
if DirectAccess then
begin
if AFile.IconOverlayID >= SystemIconIndexStart then
Result:= DrawBitmap(AFile.IconOverlayID
{$IFDEF RabbitVCS} - SystemIconIndexStart {$ENDIF},
Canvas, X, Y)
{$IF DEFINED(MSWINDOWS)}
if AFile.IconOverlayID >= SystemIconIndexStart then
Result:= DrawBitmap(AFile.IconOverlayID, Canvas, X, Y)
// Special case for OneDrive
else if AFile.IconOverlayID > 0 then
else
{$ENDIF}
if AFile.IconOverlayID > 0 then
begin
I:= gIconsSize div 2;
Result:= DrawBitmap(AFile.IconOverlayID, Canvas, X, Y + I, I, I);
end;
{$ENDIF}
end;
{$ENDIF}
;
end;
function TPixMapManager.CheckAddPixmap(AUniqueName: String; AIconSize: Integer;
@ -2743,20 +2741,25 @@ begin
else
Result:= 0;
end;
{$ELSEIF DEFINED(RabbitVCS)}
{$ELSEIF DEFINED(RabbitVCS) OR DEFINED(XDG)}
function TPixMapManager.GetIconOverlayByFile(AFile: TFile; DirectAccess: Boolean): PtrInt;
var
Emblem: String;
begin
if RabbitVCS and DirectAccess then
if not DirectAccess then Exit(0);
{$IF DEFINED(RabbitVCS)}
if RabbitVCS then
begin
Emblem:= CheckStatus(AFile.FullPath);
if Length(Emblem) = 0 then Exit(0);
Result:= CheckAddThemePixmap(Emblem);
Result:= IfThen(Result < 0, 0, Result + SystemIconIndexStart);
end
else
Result:= 0;
end;
if (not RabbitVCS) or (Length(Emblem) = 0) then
{$ENDIF}
begin
Emblem:= GioFileGetEmblem(AFile.FullPath);
end;
if Length(Emblem) = 0 then Exit(0);
Result:= CheckAddThemePixmap(Emblem, gIconsSize div 2);
Result:= IfThen(Result < 0, 0, Result);
end;
{$ENDIF}

View file

@ -2143,7 +2143,7 @@ begin
{ Icons page }
gShowIcons := sim_all_and_exe;
gShowIconsNew := gShowIcons;
gIconOverlays := {$IFDEF UNIX}True{$ELSE}False{$ENDIF};
gIconOverlays := False;
gIconsSize := 32;
gIconsSizeNew := gIconsSize;
gDiskIconsSize := 16;