diff --git a/lcl/controls.pp b/lcl/controls.pp index c2a250b111..0b92db26c6 100644 --- a/lcl/controls.pp +++ b/lcl/controls.pp @@ -373,7 +373,7 @@ type FImageIndex: Integer; procedure SetDragCursor(const AValue: TCursor); function GetResolution(AImageWidth: Integer): TDragImageListResolution; - function GetResolutionForImagePPI(AImageWidth, + function GetResolutionForPPI(AImageWidth, APPI: Integer): TDragImageListResolution; function GetDragging: Boolean; function GetDraggingResolution: TDragImageListResolution; @@ -396,7 +396,7 @@ type property Dragging: Boolean read GetDragging; property DraggingResolution: TDragImageListResolution read GetDraggingResolution; property Resolution[AImageWidth: Integer]: TDragImageListResolution read GetResolution; - property ResolutionForImagePPI[AImageWidth, APPI: Integer]: TDragImageListResolution read GetResolutionForImagePPI; + property ResolutionForPPI[AImageWidth, APPI: Integer]: TDragImageListResolution read GetResolutionForPPI; end; TKeyEvent = procedure(Sender: TObject; var Key: Word; Shift: TShiftState) of Object; @@ -2394,6 +2394,7 @@ type property ShareImages; property Width; property OnChange; + property OnGetWidthForPPI; end; diff --git a/lcl/grids.pas b/lcl/grids.pas index 5f783b0961..c8aff4bc36 100644 --- a/lcl/grids.pas +++ b/lcl/grids.pas @@ -5386,7 +5386,7 @@ begin not InRange(c.Title.ImageIndex, 0, TitleImageList.Count - 1) then exit; - aSize := TitleImageList.SizeForImagePPI[TitleImageListWidth, Font.PixelsPerInch]; + aSize := TitleImageList.SizeForPPI[TitleImageListWidth, Font.PixelsPerInch]; aWidth := aSize.Width; aHeight := aSize.Height; imgLayout := c.Title.ImageLayout; diff --git a/lcl/imglist.pp b/lcl/imglist.pp index f232f422a4..36e983e7b1 100644 --- a/lcl/imglist.pp +++ b/lcl/imglist.pp @@ -211,7 +211,7 @@ type property Current: TCustomImageListResolution read GetCurrent; end; - TCustomImageListGetWidthForImagePPI = procedure(Sender: TCustomImageList; + TCustomImageListGetWidthForPPI = procedure(Sender: TCustomImageList; AImageWidth, APPI: Integer; var AResultWidth: Integer) of object; TCustomImageList = class(TLCLComponent) @@ -232,7 +232,7 @@ type FUpdateCount: integer; FOverlays: array[TOverlay] of Integer; fHasOverlays: boolean; - FOnGetWidthForImagePPI: TCustomImageListGetWidthForImagePPI; + FOnGetWidthForPPI: TCustomImageListGetWidthForPPI; procedure NotifyChangeLink; procedure SetBkColor(const Value: TColor); @@ -242,12 +242,12 @@ type procedure SetShareImages(const AValue: Boolean); procedure SetWidth(const Value: Integer); function GetReference(AImageWidth: Integer): TWSCustomImageListReference; - function GetReferenceForImagePPI(AImageWidth, APPI: Integer): TWSCustomImageListReference; - function GetResolutionForImagePPI(AImageWidth, APPI: Integer): TCustomImageListResolution; - function GetWidthForImagePPI(AImageWidth, APPI: Integer): Integer; - function GetHeightForImagePPI(AImageWidth, APPI: Integer): Integer; + function GetReferenceForPPI(AImageWidth, APPI: Integer): TWSCustomImageListReference; + function GetResolutionForPPI(AImageWidth, APPI: Integer): TCustomImageListResolution; + function GetWidthForPPI(AImageWidth, APPI: Integer): Integer; + function GetHeightForPPI(AImageWidth, APPI: Integer): Integer; function GetCount: Integer; - function GetSizeForImagePPI(AImageWidth, APPI: Integer): TSize; + function GetSizeForPPI(AImageWidth, APPI: Integer): TSize; function GetBestIconIndexForSize(AIcon: TCustomIcon; AWidth: Integer): Integer; function GetResolutionByIndex(AIndex: Integer): TCustomImageListResolution; function GetResolutionCount: Integer; @@ -334,23 +334,23 @@ type property Count: Integer read GetCount; property DrawingStyle: TDrawingStyle read FDrawingStyle write SetDrawingStyle default dsNormal; property Height: Integer read FHeight write SetHeight default 16; - property HeightForImagePPI[AImageWidth, APPI: Integer]: Integer read GetHeightForImagePPI; + property HeightForPPI[AImageWidth, APPI: Integer]: Integer read GetHeightForPPI; property Width: Integer read FWidth write SetWidth default 16; - property WidthForImagePPI[AImageWidth, APPI: Integer]: Integer read GetWidthForImagePPI; - property SizeForImagePPI[AImageWidth, APPI: Integer]: TSize read GetSizeForImagePPI; + property WidthForPPI[AImageWidth, APPI: Integer]: Integer read GetWidthForPPI; + property SizeForPPI[AImageWidth, APPI: Integer]: TSize read GetSizeForPPI; property OnChange: TNotifyEvent read FOnChange write FOnChange; property Masked: boolean read FMasked write SetMasked default False; property Reference[AImageWidth: Integer]: TWSCustomImageListReference read GetReference; - property ReferenceForImagePPI[AImageWidth, APPI: Integer]: TWSCustomImageListReference read GetReferenceForImagePPI; + property ReferenceForPPI[AImageWidth, APPI: Integer]: TWSCustomImageListReference read GetReferenceForPPI; property Resolution[AImageWidth: Integer]: TCustomImageListResolution read GetResolution; property ResolutionByIndex[AIndex: Integer]: TCustomImageListResolution read GetResolutionByIndex; - property ResolutionForImagePPI[AImageWidth, APPI: Integer]: TCustomImageListResolution read GetResolutionForImagePPI; + property ResolutionForPPI[AImageWidth, APPI: Integer]: TCustomImageListResolution read GetResolutionForPPI; property ResolutionCount: Integer read GetResolutionCount; function Resolutions: TCustomImageListResolutionEnumerator; function ResolutionsDesc: TCustomImageListResolutionEnumerator; property ShareImages: Boolean read FShareImages write SetShareImages default False; property ImageType: TImageType read FImageType write FImageType default itImage; - property OnGetWidthForImagePPI: TCustomImageListGetWidthForImagePPI read FOnGetWidthForImagePPI write FOnGetWidthForImagePPI; + property OnGetWidthForPPI: TCustomImageListGetWidthForPPI read FOnGetWidthForPPI write FOnGetWidthForPPI; end; implementation diff --git a/lcl/include/comboex.inc b/lcl/include/comboex.inc index d7a92b9d6b..4d7497211e 100644 --- a/lcl/include/comboex.inc +++ b/lcl/include/comboex.inc @@ -385,7 +385,7 @@ begin { do not call inherited ! } if assigned(Images) then begin aItemIndex:=-1; - ImagesSize := Images.SizeForImagePPI[ImagesWidth, Font.PixelsPerInch]; + ImagesSize := Images.SizeForPPI[ImagesWidth, Font.PixelsPerInch]; if (aMainItem or (odSelected in State)) and ((ItemsEx[Index].SelectedImageIndex>=0) and (ItemsEx[Index].SelectedImageIndex= 0 then inc(Result, aImageSize+FCoolBar.HorizontalSpacing); end; @@ -104,12 +104,12 @@ begin if Assigned(FControl) then Result := max(Result, FControl.Height+2*FCoolBar.VerticalSpacing); if Assigned(FCoolBar.Images) and (ImageIndex >= 0) then - Result := max(Result, FCoolBar.Images.HeightForImagePPI[FCoolBar.ImagesWidth, FCoolBar.Font.PixelsPerInch]+2*FCoolBar.VerticalSpacing); + Result := max(Result, FCoolBar.Images.HeightForPPI[FCoolBar.ImagesWidth, FCoolBar.Font.PixelsPerInch]+2*FCoolBar.VerticalSpacing); end else begin if Assigned(FControl) then Result := max(Result, FControl.Width+2*FCoolBar.VerticalSpacing); if Assigned(FCoolBar.Images) and (ImageIndex >= 0) then - Result := max(Result, FCoolBar.Images.WidthForImagePPI[FCoolBar.ImagesWidth, FCoolBar.Font.PixelsPerInch]+2*FCoolBar.VerticalSpacing); + Result := max(Result, FCoolBar.Images.WidthForPPI[FCoolBar.ImagesWidth, FCoolBar.Font.PixelsPerInch]+2*FCoolBar.VerticalSpacing); end; if FCoolBar.FShowText then Result := max(Result, FCoolBar.FTextHeight+2*FCoolBar.VerticalSpacing); @@ -1231,7 +1231,7 @@ var k, x, aCountM1, aLeft, aTop: Integer; begin inherited Paint; if Assigned(FImages) then - aImageSize := FImages.SizeForImagePPI[ImagesWidth, Font.PixelsPerInch]; + aImageSize := FImages.SizeForPPI[ImagesWidth, Font.PixelsPerInch]; //DebugLn('TCoolBar.Paint'); //draw Bitmap Background if FBitmap.Width > 0 then diff --git a/lcl/include/customlistview.inc b/lcl/include/customlistview.inc index 080a77c440..d5dbae9a58 100644 --- a/lcl/include/customlistview.inc +++ b/lcl/include/customlistview.inc @@ -536,7 +536,7 @@ begin for lvil := Low(TListViewImageList) to High(TListViewImageList) do begin if FImages[lvil] <> nil - then LVC.SetImageList(Self, lvil, FImages[lvil].ResolutionForImagePPI[FImagesWidth[lvil], Font.PixelsPerInch]); + then LVC.SetImageList(Self, lvil, FImages[lvil].ResolutionForPPI[FImagesWidth[lvil], Font.PixelsPerInch]); end; LVC.SetScrollBars(Self, FScrollBars); LVC.SetViewOrigin(Self, FViewOriginCache) ; @@ -1603,7 +1603,7 @@ var R: TCustomImageListResolution; begin if FImages[ALvil]<>nil then - R := FImages[ALvil].ResolutionForImagePPI[FImagesWidth[ALvil], Font.PixelsPerInch] + R := FImages[ALvil].ResolutionForPPI[FImagesWidth[ALvil], Font.PixelsPerInch] else R := nil; TWSCustomListViewClass(WidgetSetClass).SetImageList(Self, ALvil, R) diff --git a/lcl/include/dragimagelist.inc b/lcl/include/dragimagelist.inc index 0d91a26f60..a69d445ab1 100644 --- a/lcl/include/dragimagelist.inc +++ b/lcl/include/dragimagelist.inc @@ -130,10 +130,10 @@ begin Result := TDragImageListResolution; end; -function TDragImageList.GetResolutionForImagePPI(AImageWidth, +function TDragImageList.GetResolutionForPPI(AImageWidth, APPI: Integer): TDragImageListResolution; begin - Result := TDragImageListResolution(inherited ResolutionForImagePPI[AImageWidth, APPI]); + Result := TDragImageListResolution(inherited ResolutionForPPI[AImageWidth, APPI]); end; { diff --git a/lcl/include/headercontrol.inc b/lcl/include/headercontrol.inc index 860f6bb04d..ff9f868113 100644 --- a/lcl/include/headercontrol.inc +++ b/lcl/include/headercontrol.inc @@ -414,7 +414,7 @@ begin if (Images <> nil) and (Section.ImageIndex <> -1) then begin inc(ContentRect.Left); - ImagesSize := Images.SizeForImagePPI[ImagesWidth, Font.PixelsPerInch]; + ImagesSize := Images.SizeForPPI[ImagesWidth, Font.PixelsPerInch]; ThemeServices.DrawIcon(Canvas, Details, Point(ContentRect.Left, (ContentRect.Top + ContentRect.Bottom - ImagesSize.Height) div 2), Images, Section.ImageIndex); diff --git a/lcl/include/imglist.inc b/lcl/include/imglist.inc index a89d02d42d..ed279f229c 100644 --- a/lcl/include/imglist.inc +++ b/lcl/include/imglist.inc @@ -1449,12 +1449,12 @@ begin GetResolution(FWidth).GetFullRawImage(Image); end; -function TCustomImageList.GetHeightForImagePPI(AImageWidth, +function TCustomImageList.GetHeightForPPI(AImageWidth, APPI: Integer): Integer; var I: Integer; begin - AImageWidth := GetWidthForImagePPI(AImageWidth, APPI); + AImageWidth := GetWidthForPPI(AImageWidth, APPI); if FData.Find(AImageWidth, I) then Result := FData[I].Height else @@ -1482,28 +1482,28 @@ begin Result := GetResolution(AImageWidth).Reference; end; -function TCustomImageList.GetReferenceForImagePPI(AImageWidth, +function TCustomImageList.GetReferenceForPPI(AImageWidth, APPI: Integer): TWSCustomImageListReference; begin - Result := GetReference(GetWidthForImagePPI(AImageWidth, APPI)); + Result := GetReference(GetWidthForPPI(AImageWidth, APPI)); end; -function TCustomImageList.GetResolutionForImagePPI(AImageWidth, +function TCustomImageList.GetResolutionForPPI(AImageWidth, APPI: Integer): TCustomImageListResolution; begin - Result := GetResolution(GetWidthForImagePPI(AImageWidth, APPI)); + Result := GetResolution(GetWidthForPPI(AImageWidth, APPI)); end; -function TCustomImageList.GetSizeForImagePPI(AImageWidth, APPI: Integer): TSize; +function TCustomImageList.GetSizeForPPI(AImageWidth, APPI: Integer): TSize; var Res: TCustomImageListResolution; begin - Res := GetResolutionForImagePPI(AImageWidth, APPI); + Res := GetResolutionForPPI(AImageWidth, APPI); Result.Width := Res.Width; Result.Height := Res.Height; end; -function TCustomImageList.GetWidthForImagePPI(AImageWidth, +function TCustomImageList.GetWidthForPPI(AImageWidth, APPI: Integer): Integer; var Factor: Integer; @@ -1520,8 +1520,8 @@ begin Factor := Round(ScreenInfo.PixelsPerInchX/96) * 100; // 200, 300, 400, ... Result := AImageWidth * Factor div 100; - if Assigned(FOnGetWidthForImagePPI) then - FOnGetWidthForImagePPI(Self, AImageWidth, APPI, Result); + if Assigned(FOnGetWidthForPPI) then + FOnGetWidthForPPI(Self, AImageWidth, APPI, Result); end; function TCustomImageList.GetResolution( diff --git a/lcl/include/menuitem.inc b/lcl/include/menuitem.inc index bce025a16a..3bcd877184 100644 --- a/lcl/include/menuitem.inc +++ b/lcl/include/menuitem.inc @@ -487,7 +487,7 @@ begin begin GetImageList(iml, imw); if (iml <> nil) and (ImageIndex < iml.Count) then - iml.ResolutionForImagePPI[imw, 96].GetBitmap(ImageIndex, FBitmap); + iml.ResolutionForPPI[imw, 96].GetBitmap(ImageIndex, FBitmap); end; FBitmap.OnChange := @BitmapChange; @@ -998,6 +998,7 @@ function TMenuItem.GetIconSize(ADC: HDC): TPoint; var AImageList: TCustomImageList; PPI, AImageListWidth: Integer; + Size: TSize; begin FillChar(Result, SizeOf(Result), 0); if HasIcon then @@ -1008,8 +1009,9 @@ begin if (FImageIndex >= AImageList.Count) then Exit; PPI := GetDeviceCaps(ADC, LOGPIXELSX); - Result.x := AImageList.WidthForImagePPI[AImageListWidth, PPI]; - Result.y := AImageList.HeightForImagePPI[AImageListWidth, PPI]; + Size := AImageList.SizeForPPI[AImageListWidth, PPI]; + Result.x := Size.cx; + Result.y := Size.cy; end else // using size of Bitmap begin diff --git a/lcl/include/toolbutton.inc b/lcl/include/toolbutton.inc index 2267beade6..2089758b45 100644 --- a/lcl/include/toolbutton.inc +++ b/lcl/include/toolbutton.inc @@ -356,7 +356,7 @@ begin GetCurrentIcon(ImgList, ImgIndex, ImgEffect); if (ImgList<>nil) then begin - IconSize := ImgList.SizeForImagePPI[FToolBar.ImagesWidth, Font.PixelsPerInch]; + IconSize := ImgList.SizeForPPI[FToolBar.ImagesWidth, Font.PixelsPerInch]; if IconSize.Height <= 0 then IconSize.Width := 0; end; @@ -438,7 +438,7 @@ begin // draw icon if (ImgList<>nil) then - ImgList.ResolutionForImagePPI[FToolBar.ImagesWidth, Font.PixelsPerInch].Draw(Canvas, IconPos.X, IconPos.Y, ImgIndex, ImgEffect); + ImgList.ResolutionForPPI[FToolBar.ImagesWidth, Font.PixelsPerInch].Draw(Canvas, IconPos.X, IconPos.Y, ImgIndex, ImgEffect); // draw text if (TextSize.cx > 0) then @@ -1156,7 +1156,7 @@ begin GetCurrentIcon(ImgList, ImgIndex, ImgEffect); if Assigned(ImgList) then begin - IconSize := ImgList.SizeForImagePPI[FToolBar.ImagesWidth, FToolBar.Font.PixelsPerInch]; + IconSize := ImgList.SizeForPPI[FToolBar.ImagesWidth, FToolBar.Font.PixelsPerInch]; if IconSize.Height <= 0 then IconSize.Width := 0; end; end; diff --git a/lcl/include/treeview.inc b/lcl/include/treeview.inc index df72d8c169..5e1e985e4f 100644 --- a/lcl/include/treeview.inc +++ b/lcl/include/treeview.inc @@ -1716,7 +1716,7 @@ begin TV := TreeView; if (TV = nil) or (TV.StateImages = nil) then Exit; if (StateIndex < 0) or (StateIndex >= TV.StateImages.Count) then Exit; - Inc(Result, TV.StateImages.WidthForImagePPI[TV.StateImagesWidth, TV.Font.PixelsPerInch] + TV.FDefItemSpace); + Inc(Result, TV.StateImages.WidthForPPI[TV.StateImagesWidth, TV.Font.PixelsPerInch] + TV.FDefItemSpace); end; function TTreeNode.DisplayStateIconLeft: integer; @@ -1737,7 +1737,7 @@ begin else ImgIndex:=ImageIndex; if (ImgIndex<0) or (ImgIndex>=TV.Images.Count) then Exit; - Inc(Result, TV.Images.WidthForImagePPI[TV.StateImagesWidth, TV.Font.PixelsPerInch] + TV.FDefItemSpace); + Inc(Result, TV.Images.WidthForPPI[TV.StateImagesWidth, TV.Font.PixelsPerInch] + TV.FDefItemSpace); end; function TTreeNode.DisplayTextRight: integer; @@ -3613,9 +3613,9 @@ begin and HandleAllocated and Canvas.HandleAllocated then begin NewDefItemHeight:=Canvas.TextHeight(TVAutoHeightString)+FDefItemSpace; if Assigned(FImages) then - ImageSize := Images.SizeForImagePPI[ImagesWidth, Font.PixelsPerInch]; + ImageSize := Images.SizeForPPI[ImagesWidth, Font.PixelsPerInch]; if Assigned(FStateImages) then - StateImageSize := StateImages.SizeForImagePPI[StateImagesWidth, Font.PixelsPerInch]; + StateImageSize := StateImages.SizeForPPI[StateImagesWidth, Font.PixelsPerInch]; if NewDefItemHeightnil) and (ImageSize.Height+FDefItemSpace>NewDefItemHeight) then NewDefItemHeight:=ImageSize.Height+FDefItemSpace; @@ -5250,9 +5250,9 @@ var ImageSize, StateImageSize: TSize; begin if Assigned(FImages) then - ImageSize := Images.SizeForImagePPI[ImagesWidth, Font.PixelsPerInch]; + ImageSize := Images.SizeForPPI[ImagesWidth, Font.PixelsPerInch]; if Assigned(FStateImages) then - StateImageSize := StateImages.SizeForImagePPI[StateImagesWidth, Font.PixelsPerInch]; + StateImageSize := StateImages.SizeForPPI[StateImagesWidth, Font.PixelsPerInch]; RealExpandSignSize := ExpandSignSize; RealIndent := Indent; NodeRect := Node.DisplayRect(False); @@ -5811,7 +5811,7 @@ begin if Images <> nil then begin Images.RegisterChanges(FImageChangeLink); Images.FreeNotification(Self); - AImageHeight := Images.HeightForImagePPI[ImagesWidth, Font.PixelsPerInch]; + AImageHeight := Images.HeightForPPI[ImagesWidth, Font.PixelsPerInch]; if DefaultItemHeight nil then begin StateImages.RegisterChanges(FStateChangeLink); StateImages.FreeNotification(Self); - AStateImageHeight := StateImages.HeightForImagePPI[StateImagesWidth, Font.PixelsPerInch]; + AStateImageHeight := StateImages.HeightForPPI[StateImagesWidth, Font.PixelsPerInch]; if DefaultItemHeight0) and (IconSize.Height>0); end; diff --git a/lcl/interfaces/gtk2/gtk2wscustomlistview.inc b/lcl/interfaces/gtk2/gtk2wscustomlistview.inc index 2a61a68442..108fec3413 100644 --- a/lcl/interfaces/gtk2/gtk2wscustomlistview.inc +++ b/lcl/interfaces/gtk2/gtk2wscustomlistview.inc @@ -1448,7 +1448,7 @@ begin if Assigned(ImgList) and (ImgList.Count > 0) and (AImageIndex >= 0) then begin - ImgListRes := ImgList.ResolutionForImagePPI[ImgListWidth, ALV.Font.PixelsPerInch]; + ImgListRes := ImgList.ResolutionForPPI[ImgListWidth, ALV.Font.PixelsPerInch]; if (ImgList.Count <> Widgets^.Images.Count) then begin if (TListView(ALV).ViewStyle in [vsSmallIcon, vsReport, vsList]) then diff --git a/lcl/interfaces/qt/qtpagecontrol.inc b/lcl/interfaces/qt/qtpagecontrol.inc index f60348c98d..b14c29613b 100644 --- a/lcl/interfaces/qt/qtpagecontrol.inc +++ b/lcl/interfaces/qt/qtpagecontrol.inc @@ -108,7 +108,7 @@ begin if Assigned(ImageList) then begin - Res := ImageList.ResolutionForImagePPI[TCustomTabControl(ACustomPage.Parent).ImagesWidth, TCustomTabControl(ACustomPage.Parent).Font.PixelsPerInch]; + Res := ImageList.ResolutionForPPI[TCustomTabControl(ACustomPage.Parent).ImagesWidth, TCustomTabControl(ACustomPage.Parent).Font.PixelsPerInch]; ImageIndex := TCustomTabControl(ACustomPage.Parent).GetImageIndex(ACustomPage.PageIndex); if (ImageIndex >= 0) and (ImageIndex < Res.Count) then begin diff --git a/lcl/interfaces/qt/qtwidgets.pas b/lcl/interfaces/qt/qtwidgets.pas index 15b0806ee9..fa4af1537f 100644 --- a/lcl/interfaces/qt/qtwidgets.pas +++ b/lcl/interfaces/qt/qtwidgets.pas @@ -12557,7 +12557,7 @@ begin ImgList := TCustomListViewHack(LCLObject).SmallImages; if Assigned(ImgList) then begin - ImgListRes := ImgList.ResolutionForImagePPI[TCustomListViewHack(LCLObject).SmallImagesWidth, TCustomListViewHack(LCLObject).Font.PixelsPerInch]; + ImgListRes := ImgList.ResolutionForPPI[TCustomListViewHack(LCLObject).SmallImagesWidth, TCustomListViewHack(LCLObject).Font.PixelsPerInch]; QListWidgetItem_sizeHint(item, @ASize); if (ASize.cx <> ImgListRes.Width) or (ASize.cx <> ImgListRes.Height) then begin @@ -14717,7 +14717,7 @@ begin ImgList := TCustomListViewHack(LCLObject).SmallImages; if Assigned(ImgList) then begin - ImgListRes := ImgList.ResolutionForImagePPI[TCustomListViewHack(LCLObject).SmallImagesWidth, TCustomListViewHack(LCLObject).Font.PixelsPerInch]; + ImgListRes := ImgList.ResolutionForPPI[TCustomListViewHack(LCLObject).SmallImagesWidth, TCustomListViewHack(LCLObject).Font.PixelsPerInch]; QTreeWidgetItem_sizeHint(item, @ASize, 0); if (ASize.cx <> ImgListRes.Width) or (ASize.cx <> ImgListRes.Height) then begin diff --git a/lcl/interfaces/qt/qtwsmenus.pp b/lcl/interfaces/qt/qtwsmenus.pp index 7dd5228f70..3ef9b5b3fa 100644 --- a/lcl/interfaces/qt/qtwsmenus.pp +++ b/lcl/interfaces/qt/qtwsmenus.pp @@ -125,7 +125,7 @@ begin if (ImgList <> nil) and (AMenuItem.ImageIndex >= 0) and (AMenuItem.ImageIndex < ImgList.Count) then begin - ImgList.ResolutionForImagePPI[16, ScreenInfo.PixelsPerInchX].GetBitmap(AMenuItem.ImageIndex, AMenuItem.Bitmap); // Qt bindings support only 16px icons for menu items + ImgList.ResolutionForPPI[16, ScreenInfo.PixelsPerInchX].GetBitmap(AMenuItem.ImageIndex, AMenuItem.Bitmap); // Qt bindings support only 16px icons for menu items Result.setImage(TQtImage(AMenuItem.Bitmap.Handle)); end else if Assigned(AMenuItem.Bitmap) then diff --git a/lcl/interfaces/qt5/qtpagecontrol.inc b/lcl/interfaces/qt5/qtpagecontrol.inc index 1bbac2828a..a496b637c7 100644 --- a/lcl/interfaces/qt5/qtpagecontrol.inc +++ b/lcl/interfaces/qt5/qtpagecontrol.inc @@ -108,7 +108,7 @@ begin if Assigned(ImageList) then begin - Res := ImageList.ResolutionForImagePPI[TCustomTabControl(ACustomPage.Parent).ImagesWidth, TCustomTabControl(ACustomPage.Parent).Font.PixelsPerInch]; + Res := ImageList.ResolutionForPPI[TCustomTabControl(ACustomPage.Parent).ImagesWidth, TCustomTabControl(ACustomPage.Parent).Font.PixelsPerInch]; ImageIndex := TCustomTabControl(ACustomPage.Parent).GetImageIndex(ACustomPage.PageIndex); if (ImageIndex >= 0) and (ImageIndex < Res.Count) then begin diff --git a/lcl/interfaces/qt5/qtwidgets.pas b/lcl/interfaces/qt5/qtwidgets.pas index 58a3013367..6c9b055a4d 100644 --- a/lcl/interfaces/qt5/qtwidgets.pas +++ b/lcl/interfaces/qt5/qtwidgets.pas @@ -12464,7 +12464,7 @@ begin ImgList := TCustomListViewHack(LCLObject).SmallImages; if Assigned(ImgList) then begin - ImgListRes := ImgList.ResolutionForImagePPI[TCustomListViewHack(LCLObject).SmallImagesWidth, TCustomListViewHack(LCLObject).Font.PixelsPerInch]; + ImgListRes := ImgList.ResolutionForPPI[TCustomListViewHack(LCLObject).SmallImagesWidth, TCustomListViewHack(LCLObject).Font.PixelsPerInch]; QListWidgetItem_sizeHint(item, @ASize); if (ASize.cx <> ImgListRes.Width) or (ASize.cx <> ImgListRes.Height) then begin @@ -14631,7 +14631,7 @@ begin ImgList := TCustomListViewHack(LCLObject).SmallImages; if Assigned(ImgList) then begin - ImgListRes := ImgList.ResolutionForImagePPI[TCustomListViewHack(LCLObject).SmallImagesWidth, TCustomListViewHack(LCLObject).Font.PixelsPerInch]; + ImgListRes := ImgList.ResolutionForPPI[TCustomListViewHack(LCLObject).SmallImagesWidth, TCustomListViewHack(LCLObject).Font.PixelsPerInch]; QTreeWidgetItem_sizeHint(item, @ASize, 0); if (ASize.cx <> ImgListRes.Width) or (ASize.cx <> ImgListRes.Height) then begin diff --git a/lcl/interfaces/qt5/qtwsmenus.pp b/lcl/interfaces/qt5/qtwsmenus.pp index 945e51e9a0..a0caf6d8f1 100644 --- a/lcl/interfaces/qt5/qtwsmenus.pp +++ b/lcl/interfaces/qt5/qtwsmenus.pp @@ -124,7 +124,7 @@ begin if (ImgList <> nil) and (AMenuItem.ImageIndex >= 0) and (AMenuItem.ImageIndex < ImgList.Count) then begin - ImgList.ResolutionForImagePPI[16, ScreenInfo.PixelsPerInchX].GetBitmap(AMenuItem.ImageIndex, AMenuItem.Bitmap); // Qt bindings support only 16px icons for menu items + ImgList.ResolutionForPPI[16, ScreenInfo.PixelsPerInchX].GetBitmap(AMenuItem.ImageIndex, AMenuItem.Bitmap); // Qt bindings support only 16px icons for menu items Result.setImage(TQtImage(AMenuItem.Bitmap.Handle)); end else if Assigned(AMenuItem.Bitmap) then diff --git a/lcl/interfaces/win32/win32pagecontrol.inc b/lcl/interfaces/win32/win32pagecontrol.inc index b462fbd12c..d084923bf0 100644 --- a/lcl/interfaces/win32/win32pagecontrol.inc +++ b/lcl/interfaces/win32/win32pagecontrol.inc @@ -355,7 +355,7 @@ begin if not (AWinControl is TTabControl) then begin if T.Images <> nil then - SendMessage(Result, TCM_SETIMAGELIST, 0, T.Images.ReferenceForImagePPI[T.ImagesWidth, T.Font.PixelsPerInch]._Handle); + SendMessage(Result, TCM_SETIMAGELIST, 0, T.Images.ReferenceForPPI[T.ImagesWidth, T.Font.PixelsPerInch]._Handle); // although we may be child of tabpage, cut the paint chain // to improve speed and possible paint anomalities @@ -653,7 +653,7 @@ begin Exit; if AImageList <> nil then - SendMessage(ATabControl.Handle, TCM_SETIMAGELIST, 0, AImageList.ReferenceForImagePPI[ATabControl.ImagesWidth, ATabControl.Font.PixelsPerInch]._Handle) + SendMessage(ATabControl.Handle, TCM_SETIMAGELIST, 0, AImageList.ReferenceForPPI[ATabControl.ImagesWidth, ATabControl.Font.PixelsPerInch]._Handle) else SendMessage(ATabControl.Handle, TCM_SETIMAGELIST, 0, 0); // if you set big images like 32x32 then tabs will be big too => you need to diff --git a/lcl/interfaces/win32/win32wsbuttons.pp b/lcl/interfaces/win32/win32wsbuttons.pp index 9dc15cec52..2700ad65cc 100644 --- a/lcl/interfaces/win32/win32wsbuttons.pp +++ b/lcl/interfaces/win32/win32wsbuttons.pp @@ -202,7 +202,7 @@ var if (srcWidth <> 0) and (srcHeight <> 0) then begin TBitBtnAceess(BitBtn).FButtonGlyph.GetImageIndexAndEffect(AState, AIndex, AEffect); - TWin32WSCustomImageListResolution.DrawToDC(TBitBtnAceess(BitBtn).FButtonGlyph.Images.ResolutionForImagePPI[0, 96], AIndex, + TWin32WSCustomImageListResolution.DrawToDC(TBitBtnAceess(BitBtn).FButtonGlyph.Images.ResolutionForPPI[0, 96], AIndex, TmpDC, Rect(XDestBitmap, YDestBitmap, glyphWidth, glyphHeight), TBitBtnAceess(BitBtn).FButtonGlyph.Images.BkColor, TBitBtnAceess(BitBtn).FButtonGlyph.Images.BlendColor, AEffect, @@ -229,7 +229,7 @@ var if (AEffect = gdeDisabled) and not AlphaDraw then AEffect := gde1Bit; - TWin32WSCustomImageListResolution.DrawToDC(TBitBtnAceess(BitBtn).FButtonGlyph.Images.ResolutionForImagePPI[0, 96], AIndex, + TWin32WSCustomImageListResolution.DrawToDC(TBitBtnAceess(BitBtn).FButtonGlyph.Images.ResolutionForPPI[0, 96], AIndex, TmpDC, Rect(XDestBitmap, YDestBitmap, glyphWidth, glyphHeight), TBitBtnAceess(BitBtn).FButtonGlyph.Images.BkColor, TBitBtnAceess(BitBtn).FButtonGlyph.Images.BlendColor, AEffect, diff --git a/lcl/interfaces/win32/win32wsmenus.pp b/lcl/interfaces/win32/win32wsmenus.pp index 9153b7e9fe..04cb941123 100644 --- a/lcl/interfaces/win32/win32wsmenus.pp +++ b/lcl/interfaces/win32/win32wsmenus.pp @@ -1140,7 +1140,7 @@ begin if AImageIndex < AImageList.Count then begin APPI := GetDeviceCaps(AHDC, LOGPIXELSX); - TWin32WSCustomImageListResolution.DrawToDC(AImageList.ResolutionForImagePPI[AImagesWidth, APPI], + TWin32WSCustomImageListResolution.DrawToDC(AImageList.ResolutionForPPI[AImagesWidth, APPI], AImageIndex, AHDC, ImageRect, AImageList.BkColor, AImageList.BlendColor, AEffect, AImageList.DrawingStyle, AImageList.ImageType); diff --git a/lcl/menus.pp b/lcl/menus.pp index e70f4736d5..cea777f034 100644 --- a/lcl/menus.pp +++ b/lcl/menus.pp @@ -38,7 +38,7 @@ interface {$endif} uses - Classes, SysUtils, LCLStrConsts, LCLType, LCLProc, LCLIntf, InterfaceBase, + Types, Classes, SysUtils, LCLStrConsts, LCLType, LCLProc, LCLIntf, InterfaceBase, LResources, LMessages, ActnList, Graphics, ImgList, LCLClasses, Themes; type