Add: Now on Windows icons in file panels is really transparent

This commit is contained in:
Alexander Koblov 2007-04-01 12:02:10 +00:00
commit 042af43505
4 changed files with 27 additions and 21 deletions

View file

@ -24,5 +24,3 @@ along with this program; if not, write to the Free Software Foundation, Inc.,
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
For more details see the file COPYING.
!!!Caution on Linux thread does not work properly (problem with modal window)!!!

View file

@ -2,15 +2,4 @@
Сначала установите 2 пакета компонентов из папки components.
После этого откройте файл doublecmd.lpi и дайте команду "Запуск->Сборка"
!!!Внимание в Lazarus не получается показать модальное окно, которое
приостанавливало бы работу потока. Данная проблема была решена косвенным путем,
но как выяснилось
данное решение подходит только для Windows, поэтому сейчас
под Linux операции выполняющиеся в потоках корректно не работают.!!!
После этого откройте файл doublecmd.lpi и дайте команду "Запуск->Сборка"

View file

@ -495,13 +495,7 @@ begin
0:begin
if iIconID>=0 then
begin
bmp:=PixMapManager.GetBitmap(iIconID, Color);
if assigned(bmp) then
begin
Canvas.Draw(Rect.Left, Rect.Top ,bmp);
if iIconID >= $1000 then
FreeAndNil(bmp);
end;
PixMapManager.DrawBitmap(iIconID, Canvas, Rect);
end;
if gSeparateExt then
s:=sNameNoExt

View file

@ -38,6 +38,9 @@ uses
type
{ TPixMapManager }
TPixMapManager=class
private
@ -58,6 +61,7 @@ type
destructor Destroy; override;
procedure Load(const sFileName:String);
function GetBitmap(iIndex:Integer; BkColor : TColor):TBitmap;
function DrawBitmap(iIndex: Integer; Canvas : TCanvas; Rect : TRect) : Boolean;
Function GetIconByFile(fi:PFileRecItem):Integer;
end;
@ -212,6 +216,27 @@ begin
{$ENDIF}
end;
function TPixMapManager.DrawBitmap(iIndex: Integer; Canvas: TCanvas; Rect: TRect): Boolean;
begin
Result := True;
if iIndex < FimgList.Count then
Canvas.Draw(Rect.Left, Rect.Top ,Graphics.TBitmap(FimgList.Items[iIndex]))
else
{$IFDEF WIN32}
if iIndex >= $1000 then
try
(*For transparent*)
ImageList_Draw(SysImgList, iIndex - $1000, Canvas.Handle, Rect.Left, Rect.Top, ILD_TRANSPARENT);
except
Result:= False;
end;
{$ELSE}
Result:= False;
{$ENDIF}
end;
function TPixMapManager.GetIconByFile(fi: PFileRecItem): Integer;
var
Ext : String;