mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-27 10:00:40 +02:00
Merge branch 'qtmenus-scaled-images' into 'main'
Qt: Fixed menus backed by multi-resolution image lists always using the 96ppi... See merge request freepascal.org/lazarus/lazarus!282
This commit is contained in:
commit
c8ff920fa6
@ -136,8 +136,13 @@ begin
|
||||
if (ImgList <> nil) and (AMenuItem.ImageIndex >= 0) and
|
||||
(AMenuItem.ImageIndex < ImgList.Count) then
|
||||
begin
|
||||
ImgList.ResolutionForPPI[16, ScreenInfo.PixelsPerInchX, 1].GetBitmap(AMenuItem.ImageIndex, AMenuItem.Bitmap); // Qt bindings support only 16px icons for menu items
|
||||
Result.setImage(TQtImage(AMenuItem.Bitmap.Handle));
|
||||
Bmp := TBitmap.Create;
|
||||
try
|
||||
ImgList.ResolutionForPPI[16, ScreenInfo.PixelsPerInchX, 1].GetBitmap(AMenuItem.ImageIndex, Bmp); // Qt bindings support only 16px icons for menu items
|
||||
Result.setImage(TQtImage(Bmp.Handle));
|
||||
finally
|
||||
Bmp.Free;
|
||||
end;
|
||||
end else
|
||||
if Assigned(AMenuItem.Bitmap) then
|
||||
begin
|
||||
|
@ -135,8 +135,13 @@ begin
|
||||
if (ImgList <> nil) and (AMenuItem.ImageIndex >= 0) and
|
||||
(AMenuItem.ImageIndex < ImgList.Count) then
|
||||
begin
|
||||
ImgList.ResolutionForPPI[16, ScreenInfo.PixelsPerInchX, 1].GetBitmap(AMenuItem.ImageIndex, AMenuItem.Bitmap); // Qt bindings support only 16px icons for menu items
|
||||
Result.setImage(TQtImage(AMenuItem.Bitmap.Handle));
|
||||
Bmp := TBitmap.Create;
|
||||
try
|
||||
ImgList.ResolutionForPPI[16, ScreenInfo.PixelsPerInchX, 1].GetBitmap(AMenuItem.ImageIndex, Bmp); // Qt bindings support only 16px icons for menu items
|
||||
Result.setImage(TQtImage(Bmp.Handle));
|
||||
finally
|
||||
Bmp.Free;
|
||||
end;
|
||||
end else
|
||||
if Assigned(AMenuItem.Bitmap) then
|
||||
begin
|
||||
|
@ -135,8 +135,13 @@ begin
|
||||
if (ImgList <> nil) and (AMenuItem.ImageIndex >= 0) and
|
||||
(AMenuItem.ImageIndex < ImgList.Count) then
|
||||
begin
|
||||
ImgList.ResolutionForPPI[16, ScreenInfo.PixelsPerInchX, 1].GetBitmap(AMenuItem.ImageIndex, AMenuItem.Bitmap); // Qt bindings support only 16px icons for menu items
|
||||
Result.setImage(TQtImage(AMenuItem.Bitmap.Handle));
|
||||
Bmp := TBitmap.Create;
|
||||
try
|
||||
ImgList.ResolutionForPPI[16, ScreenInfo.PixelsPerInchX, 1].GetBitmap(AMenuItem.ImageIndex, Bmp); // Qt bindings support only 16px icons for menu items
|
||||
Result.setImage(TQtImage(Bmp.Handle));
|
||||
finally
|
||||
Bmp.Free;
|
||||
end;
|
||||
end else
|
||||
if Assigned(AMenuItem.Bitmap) then
|
||||
begin
|
||||
|
Loading…
Reference in New Issue
Block a user