mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-22 20:39:25 +02:00
Cocoa: revert not working TBitBtn retina glyph support
git-svn-id: trunk@57848 -
This commit is contained in:
parent
014d35df8e
commit
a6549c23c1
@ -132,13 +132,13 @@ begin
|
|||||||
begin
|
begin
|
||||||
AGlyph := TBitmap.Create;
|
AGlyph := TBitmap.Create;
|
||||||
AValue.GetImageIndexAndEffect(bsUp, ABitBtn.Font.PixelsPerInch,
|
AValue.GetImageIndexAndEffect(bsUp, ABitBtn.Font.PixelsPerInch,
|
||||||
ABitBtn.GetCanvasScaleFactor, AImgRes, AIndex, AEffect);
|
1{To-Do: ABitBtn.GetCanvasScaleFactor}, AImgRes, AIndex, AEffect);
|
||||||
AImgRes.GetBitmap(AIndex, AGlyph, AEffect);
|
AImgRes.GetBitmap(AIndex, AGlyph, AEffect);
|
||||||
Img := TCocoaBitmap(AGlyph.Handle).image;
|
Img := TCocoaBitmap(AGlyph.Handle).image;
|
||||||
lButtonHandle := TCocoaButton(ABitBtn.Handle);
|
lButtonHandle := TCocoaButton(ABitBtn.Handle);
|
||||||
lButtonHandle.setImage(Img);
|
lButtonHandle.setImage(Img);
|
||||||
lButtonHandle.setImagePosition(LCLGlyphPosToCocoa(ABitBtn.Layout));
|
lButtonHandle.setImagePosition(LCLGlyphPosToCocoa(ABitBtn.Layout));
|
||||||
//To-Do: lButtonHandle.setMatchesOnlyOnBestFittingAxis(True);
|
//To-Do: tell Cocoa lButtonHandle should not scale the image (and enable ABitBtn.GetCanvasScaleFactor above)
|
||||||
if Assigned(lButtonHandle.Glyph) then
|
if Assigned(lButtonHandle.Glyph) then
|
||||||
FreeAndNil(lButtonHandle.Glyph);
|
FreeAndNil(lButtonHandle.Glyph);
|
||||||
lButtonHandle.Glyph := AGlyph;
|
lButtonHandle.Glyph := AGlyph;
|
||||||
|
Loading…
Reference in New Issue
Block a user