From e1b2a50f190990e56c3d473f497d2f10436de655 Mon Sep 17 00:00:00 2001 From: juha Date: Mon, 8 Oct 2018 13:40:49 +0000 Subject: [PATCH] IDE: Center icon and text vertically for each item in ViewUnit dialog. Issue #34402, patch from Vojtech Cihak. git-svn-id: trunk@59272 - --- ide/viewunit_dlg.pp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ide/viewunit_dlg.pp b/ide/viewunit_dlg.pp index 7ac30bae77..16b49639f5 100644 --- a/ide/viewunit_dlg.pp +++ b/ide/viewunit_dlg.pp @@ -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;