mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-09 08:47:59 +02:00
- speedup imagelist a bit (thanks to Marc)
- make speedbutton glyph more shiny when mouse over the button git-svn-id: trunk@12780 -
This commit is contained in:
parent
ee80b0fd46
commit
38ac66bbd3
@ -210,7 +210,7 @@ type
|
||||
FDownLoaded : Boolean;// value of Down set during loading
|
||||
FDragging: Boolean;
|
||||
FFlat: Boolean;
|
||||
FGlyph: TButtonGlyph;
|
||||
FGlyph: TButtonGlyph;
|
||||
FGroupIndex: Integer;
|
||||
FLastDrawDetails: TThemedElementDetails;
|
||||
FLayout: TButtonLayout;
|
||||
|
@ -867,13 +867,15 @@ begin
|
||||
end
|
||||
else msk := AMask.Handle;
|
||||
|
||||
R := Rect(0, 0, FWidth, FHeight);
|
||||
for i := 0 to ACount - 1 do
|
||||
begin
|
||||
R := Rect(FWidth * i, 0, FWidth * (i + 1), FHeight);
|
||||
RawImage_FromBitmap(RawImg, AImage.Handle, msk, R);
|
||||
ImgData := InternalSetImage(AIndex + i, RawImg);
|
||||
if HandleAllocated
|
||||
then TWSCustomImageListClass(WidgetSetClass).Insert(Self, AIndex + i, ImgData);
|
||||
inc(R.Left, FWidth);
|
||||
inc(R.Right, FWidth);
|
||||
end;
|
||||
{$endif}
|
||||
|
||||
|
@ -892,10 +892,14 @@ function TCustomSpeedButton.DrawGlyph(ACanvas: TCanvas; const AClient: TRect;
|
||||
BiDiFlags: Longint): TRect;
|
||||
begin
|
||||
if Assigned(FGlyph) then
|
||||
if (AState = bsDown) or (Down = true) then
|
||||
Result := FGlyph.Draw(ACanvas, AClient, point(AOffset.x + 1, AOffset.y + 1), AState, ATransparent, BiDiFlags)
|
||||
else
|
||||
Result := FGlyph.Draw(ACanvas, AClient, AOffset, AState, ATransparent, BiDiFlags);
|
||||
begin
|
||||
if (AState = bsUp) and FMouseInControl then
|
||||
AState := bsExclusive;
|
||||
if (AState = bsDown) or (Down = true) then
|
||||
Result := FGlyph.Draw(ACanvas, AClient, point(AOffset.x + 1, AOffset.y + 1), AState, ATransparent, BiDiFlags)
|
||||
else
|
||||
Result := FGlyph.Draw(ACanvas, AClient, AOffset, AState, ATransparent, BiDiFlags);
|
||||
end;
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
|
Loading…
Reference in New Issue
Block a user