mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-11 17:16:01 +02:00
IDE: Image List Editor: fix image listbox painting
git-svn-id: trunk@57173 -
This commit is contained in:
parent
1d82a118e9
commit
09b0e087f7
@ -305,7 +305,6 @@ begin
|
|||||||
Y := ARect.Top+Control.Scale96ToFont(2);
|
Y := ARect.Top+Control.Scale96ToFont(2);
|
||||||
C.TextOut(X, Y, IntToStr(Index));
|
C.TextOut(X, Y, IntToStr(Index));
|
||||||
Inc(X, C.TextWidth('0')*4);
|
Inc(X, C.TextWidth('0')*4);
|
||||||
InflateRect(ARect, Control.Scale96ToFont(2), Control.Scale96ToFont(2));
|
|
||||||
C.ClipRect := ARect;
|
C.ClipRect := ARect;
|
||||||
C.Clipping := True;
|
C.Clipping := True;
|
||||||
|
|
||||||
@ -569,12 +568,19 @@ end;
|
|||||||
procedure TImageListEditorDlg.RefreshItemHeight;
|
procedure TImageListEditorDlg.RefreshItemHeight;
|
||||||
var
|
var
|
||||||
R: TCustomImageListResolution;
|
R: TCustomImageListResolution;
|
||||||
|
ItemHeight, MaxHeight: Integer;
|
||||||
begin
|
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
|
begin
|
||||||
ImageListBox.ItemHeight := Min(R.Height, Scale96ToFont(32)) + Scale96ToFont(4);
|
if R.Height <= MaxHeight then
|
||||||
break;
|
ItemHeight := Max(ItemHeight, R.Height)
|
||||||
|
else
|
||||||
|
break;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
ImageListBox.ItemHeight := ItemHeight + Scale96ToFont(4);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
class function TImageListEditorDlg.ResolutionToString(
|
class function TImageListEditorDlg.ResolutionToString(
|
||||||
|
Loading…
Reference in New Issue
Block a user