mirror of
https://github.com/doublecmd/doublecmd.git
synced 2026-06-21 09:58:13 +00:00
ADD: Display RabbitVCS and GVfs emblems when overlay icons enabled
This commit is contained in:
parent
b51733f25e
commit
4178f6e58f
5 changed files with 36 additions and 22 deletions
|
|
@ -173,6 +173,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>
|
||||
|
|
@ -1461,6 +1466,7 @@ end;"/>
|
|||
<Unit183>
|
||||
<Filename Value="filesources\wfxplugin\uwfxplugindeleteoperation.pas"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<UnitName Value="uWfxPluginDeleteOperation"/>
|
||||
</Unit183>
|
||||
<Unit184>
|
||||
<Filename Value="filesources\wfxplugin\uwfxpluginexecuteoperation.pas"/>
|
||||
|
|
@ -2211,6 +2217,11 @@ end;
|
|||
if (LCLWidgetType = 'qt6') and (TargetOS <> 'darwin') then
|
||||
begin
|
||||
UnitPath += 'platform/$(SrcOS)/qt6;platform/$(SrcOS)/wayland;';
|
||||
end;
|
||||
|
||||
if (SrcOS = 'unix') and (TargetOS <> 'darwin') and (TargetOS <> 'haiku') then
|
||||
begin
|
||||
CustomOptions += '-dXDG -dRabbitVCS';
|
||||
end;"/>
|
||||
<Parsing>
|
||||
<SyntaxOptions>
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -341,7 +341,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.
|
||||
|
||||
|
|
@ -417,7 +417,7 @@ type
|
|||
TBitmap = Graphics.TBitmap;
|
||||
{$ENDIF}
|
||||
|
||||
{$IF DEFINED(MSWINDOWS) OR DEFINED(RabbitVCS)}
|
||||
{$IF DEFINED(MSWINDOWS)}
|
||||
const
|
||||
SystemIconIndexStart: PtrInt = High(PtrInt) div 2;
|
||||
{$ENDIF}
|
||||
|
|
@ -2130,25 +2130,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;
|
||||
|
|
@ -2626,20 +2624,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}
|
||||
|
||||
|
|
|
|||
|
|
@ -2205,7 +2205,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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue