IDE: Center icon and text vertically for each item in ViewUnit dialog. Issue #34402, patch from Vojtech Cihak.

git-svn-id: trunk@59272 -
This commit is contained in:
juha 2018-10-08 13:40:49 +00:00
parent 9fd194d243
commit e1b2a50f19

View File

@ -376,13 +376,17 @@ end;
procedure TViewUnitDialog.ListboxDrawItem(Control: TWinControl; Index: Integer;
ARect: TRect; State: TOwnerDrawState);
var
aTop: Integer;
begin
if Index < 0 then Exit;
with ListBox do
begin
Canvas.FillRect(ARect);
IDEImages.Images_16.Draw(Canvas, 1, ARect.Top, FImageIndex);
Canvas.TextRect(ARect, ARect.Left + IDEImages.Images_16.Width + Scale96ToFont(4), ARect.Top, Items[Index]);
aTop := (ARect.Bottom + ARect.Top - IDEImages.Images_16.Height) div 2;
IDEImages.Images_16.Draw(Canvas, 1, aTop, FImageIndex);
aTop := (ARect.Bottom + ARect.Top - Canvas.TextHeight('Šj9')) div 2;
Canvas.TextRect(ARect, ARect.Left + IDEImages.Images_16.Width + Scale96ToFont(4), aTop, Items[Index]);
end;
end;