diff --git a/lcl/buttons.pp b/lcl/buttons.pp index fa6e86aca1..912db262c4 100644 --- a/lcl/buttons.pp +++ b/lcl/buttons.pp @@ -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; diff --git a/lcl/include/imglist.inc b/lcl/include/imglist.inc index dad71eec67..44c83ccfd4 100644 --- a/lcl/include/imglist.inc +++ b/lcl/include/imglist.inc @@ -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} diff --git a/lcl/include/speedbutton.inc b/lcl/include/speedbutton.inc index bf470ebcd4..caf0d17b09 100644 --- a/lcl/include/speedbutton.inc +++ b/lcl/include/speedbutton.inc @@ -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; {------------------------------------------------------------------------------