You've already forked lazarus-ccr
tvplanit: Fix Linux qt not painting internal tasklist icon.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@5904 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -230,9 +230,8 @@ var
|
|||||||
GlyphRect: TRect;
|
GlyphRect: TRect;
|
||||||
HeadStr: string;
|
HeadStr: string;
|
||||||
delta: Integer;
|
delta: Integer;
|
||||||
w, h, h0: Integer;
|
w, h: Integer;
|
||||||
bmp: TBitmap;
|
bmp: TBitmap;
|
||||||
png: TPortableNetworkGraphic;
|
|
||||||
begin
|
begin
|
||||||
RenderCanvas.Brush.Color := TaskHeadAttrColor;
|
RenderCanvas.Brush.Color := TaskHeadAttrColor;
|
||||||
RenderCanvas.Font.Assign(FTaskList.TaskHeadAttributes.Font);
|
RenderCanvas.Font.Assign(FTaskList.TaskHeadAttributes.Font);
|
||||||
@ -267,53 +266,18 @@ begin
|
|||||||
|
|
||||||
{ Draw the glyph }
|
{ Draw the glyph }
|
||||||
if FTaskList.ShowIcon then begin
|
if FTaskList.ShowIcon then begin
|
||||||
{$IFDEF NEW_ICONS}
|
bmp := TBitmap.Create;
|
||||||
h0 := HeightOf(HeadRect) - 2;
|
|
||||||
if h0 >= 32 then
|
|
||||||
png := CreatePngFromRCDATA('VPTASKS32')
|
|
||||||
else if h0 >= 24 then
|
|
||||||
png := CreatePngFromRCDATA('VPTASKS24')
|
|
||||||
else
|
|
||||||
png := CreatePngFromRCDATA('VPTASKS16');
|
|
||||||
try
|
|
||||||
if png.Height > 0 then begin
|
|
||||||
bmp := TBitmap.Create;
|
|
||||||
try
|
|
||||||
bmp.PixelFormat := pf32Bit;
|
|
||||||
bmp.Width := png.Width;
|
|
||||||
bmp.Height := png.Height;
|
|
||||||
bmp.Canvas.Brush.color := clWhite;
|
|
||||||
bmp.Canvas.FillRect(Rect(0, 0, bmp.Width, bmp.Height));
|
|
||||||
bmp.Canvas.Draw(0, 0, png);
|
|
||||||
|
|
||||||
w := Round(bmp.Width * Scale);
|
|
||||||
h := Round(bmp.Height * Scale);
|
|
||||||
|
|
||||||
GlyphRect.TopLeft := Point(HeadRect.Left + TextMargin, (Headrect.Top + HeadRect.Bottom - h) div 2);
|
|
||||||
GlyphRect.BottomRight := Point(GlyphRect.Left + w, GlyphRect.Top + h);
|
|
||||||
|
|
||||||
{$IFDEF FPC}
|
|
||||||
RotateBitmap(Bmp, Angle);
|
|
||||||
{$ENDIF}
|
|
||||||
|
|
||||||
TPSStretchDraw(RenderCanvas, Angle, RenderIn, GlyphRect, Bmp);
|
|
||||||
|
|
||||||
HeadRect.Left := HeadRect.Left + w + TextMargin;
|
|
||||||
finally
|
|
||||||
bmp.Free;
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
finally
|
|
||||||
png.Free;
|
|
||||||
end;
|
|
||||||
{$ELSE}
|
|
||||||
Bmp := Graphics.TBitmap.Create;
|
|
||||||
try
|
try
|
||||||
|
{$IFDEF NEW_ICONS}
|
||||||
|
LoadGlyphFromRCDATA(bmp, 'VPTASKS', 16, 24, 32);
|
||||||
|
{$ELSE}
|
||||||
Bmp.LoadFromResourceName(HINSTANCE, 'VPCHECKPAD'); //soner changed: Bmp.Handle := LoadBaseBitmap('VPCHECKPAD');
|
Bmp.LoadFromResourceName(HINSTANCE, 'VPCHECKPAD'); //soner changed: Bmp.Handle := LoadBaseBitmap('VPCHECKPAD');
|
||||||
if Bmp.Height > 0 then begin
|
{$ENDIF}
|
||||||
w := Round(Bmp.Width * Scale);
|
if bmp.Height > 0 then
|
||||||
h := Round(Bmp.Height * Scale);
|
begin
|
||||||
GlyphRect.TopLeft := Point(HeadRect.Left + TextMargin, HeadRect.Top + TextMargin);
|
w := Round(bmp.Width * Scale);
|
||||||
|
h := Round(bmp.Height * Scale);
|
||||||
|
GlyphRect.TopLeft := Point(HeadRect.Left + TextMargin, (Headrect.Top + HeadRect.Bottom - h) div 2);
|
||||||
GlyphRect.BottomRight := Point(GlyphRect.Left + w, GlyphRect.Top + h);
|
GlyphRect.BottomRight := Point(GlyphRect.Left + w, GlyphRect.Top + h);
|
||||||
{$IFDEF FPC}
|
{$IFDEF FPC}
|
||||||
RotateBitmap(Bmp, Angle);
|
RotateBitmap(Bmp, Angle);
|
||||||
@ -322,9 +286,8 @@ begin
|
|||||||
HeadRect.Left := HeadRect.Left + w + TextMargin;
|
HeadRect.Left := HeadRect.Left + w + TextMargin;
|
||||||
end;
|
end;
|
||||||
finally
|
finally
|
||||||
Bmp.Free;
|
bmp.Free;
|
||||||
end;
|
end;
|
||||||
{$ENDIF}
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ draw the text }
|
{ draw the text }
|
||||||
|
Reference in New Issue
Block a user