IDE: Image List Editor: fix image listbox painting

git-svn-id: trunk@57173 -
This commit is contained in:
ondrej 2018-01-28 06:52:54 +00:00
parent 1d82a118e9
commit 09b0e087f7

View File

@ -305,7 +305,6 @@ begin
Y := ARect.Top+Control.Scale96ToFont(2);
C.TextOut(X, Y, IntToStr(Index));
Inc(X, C.TextWidth('0')*4);
InflateRect(ARect, Control.Scale96ToFont(2), Control.Scale96ToFont(2));
C.ClipRect := ARect;
C.Clipping := True;
@ -569,12 +568,19 @@ end;
procedure TImageListEditorDlg.RefreshItemHeight;
var
R: TCustomImageListResolution;
ItemHeight, MaxHeight: Integer;
begin
for R in ImageList.ResolutionsDesc do // get highest resolution
ItemHeight := ImageListBox.Canvas.TextHeight('Hg');
MaxHeight := Scale96ToFont(32);
for R in ImageList.Resolutions do
begin
ImageListBox.ItemHeight := Min(R.Height, Scale96ToFont(32)) + Scale96ToFont(4);
break;
if R.Height <= MaxHeight then
ItemHeight := Max(ItemHeight, R.Height)
else
break;
end;
ImageListBox.ItemHeight := ItemHeight + Scale96ToFont(4);
end;
class function TImageListEditorDlg.ResolutionToString(