mirror of
https://github.com/doublecmd/doublecmd.git
synced 2026-06-21 09:58:13 +00:00
FIX: Bug [0002321] Some icons of hidden files are not dimmed despite the setting
This commit is contained in:
parent
ddc194d522
commit
58300e8fae
1 changed files with 33 additions and 4 deletions
|
|
@ -75,20 +75,49 @@ procedure BitmapAlpha(var ABitmap: TBitmap; APercent: Single);
|
|||
var
|
||||
X, Y: Integer;
|
||||
Color: TFPColor;
|
||||
Masked: Boolean;
|
||||
AImage: TLazIntfImage;
|
||||
SrcIntfImage: TLazIntfImage;
|
||||
begin
|
||||
if ABitmap.RawImage.Description.AlphaPrec <> 0 then
|
||||
begin
|
||||
AImage:= TLazIntfImage.Create(ABitmap.RawImage, False);
|
||||
ABitmap.BeginUpdate;
|
||||
try
|
||||
AImage:= TLazIntfImage.Create(ABitmap.RawImage, False);
|
||||
for X:= 0 to AImage.Width - 1 do
|
||||
begin
|
||||
for Y:= 0 to AImage.Height - 1 do
|
||||
begin
|
||||
Color:= AImage.Colors[X, Y];
|
||||
Color.Alpha:= Round(Color.Alpha * APercent);
|
||||
AImage.Colors[X, Y]:= Color;
|
||||
end;
|
||||
end;
|
||||
AImage.Free;
|
||||
finally
|
||||
ABitmap.EndUpdate;
|
||||
end;
|
||||
end
|
||||
else begin
|
||||
Masked:= ABitmap.RawImage.Description.MaskBitsPerPixel > 0;
|
||||
SrcIntfImage:= TLazIntfImage.Create(ABitmap.RawImage, False);
|
||||
AImage:= TLazIntfImage.Create(ABitmap.Width, ABitmap.Height, [riqfRGB, riqfAlpha]);
|
||||
AImage.CreateData;
|
||||
for X:= 0 to AImage.Width - 1 do
|
||||
begin
|
||||
for Y:= 0 to AImage.Height - 1 do
|
||||
begin
|
||||
Color:= AImage.Colors[X, Y];
|
||||
Color.Alpha:= Round(Color.Alpha * APercent);
|
||||
Color := SrcIntfImage.Colors[X, Y];
|
||||
if Masked and SrcIntfImage.Masked[X, Y] then
|
||||
Color.Alpha:= Low(Color.Alpha)
|
||||
else begin
|
||||
Color.Alpha:= Round(High(Color.Alpha) * APercent);
|
||||
end;
|
||||
AImage.Colors[X, Y]:= Color;
|
||||
end;
|
||||
end
|
||||
end;
|
||||
SrcIntfImage.Free;
|
||||
BitmapAssign(ABitmap, AImage);
|
||||
AImage.Free;
|
||||
end;
|
||||
end;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue