mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-14 14:19:22 +02:00
IDE: center vertically text in component list
git-svn-id: trunk@47294 -
This commit is contained in:
parent
81cd0c6877
commit
059b7d50d4
@ -305,7 +305,7 @@ var
|
|||||||
Comp: TRegisteredComponent;
|
Comp: TRegisteredComponent;
|
||||||
ARect: TRect;
|
ARect: TRect;
|
||||||
CurIcon: TCustomBitmap;
|
CurIcon: TCustomBitmap;
|
||||||
Indent, IconWidth, IconHeight: Integer;
|
Indent, IconWidth, IconHeight, NodeTextHeight: Integer;
|
||||||
begin
|
begin
|
||||||
DefaultDraw := False;
|
DefaultDraw := False;
|
||||||
Indent := (Sender as TTreeView).Indent;
|
Indent := (Sender as TTreeView).Indent;
|
||||||
@ -339,6 +339,8 @@ begin
|
|||||||
ARect.Top+(ARect.Bottom-ARect.Top-IconHeight) div 2, CurIcon);
|
ARect.Top+(ARect.Bottom-ARect.Top-IconHeight) div 2, CurIcon);
|
||||||
ARect.Left := ARect.Left + IconWidth + 2;
|
ARect.Left := ARect.Left + IconWidth + 2;
|
||||||
end;
|
end;
|
||||||
|
NodeTextHeight := TextHeight(Node.Text);
|
||||||
|
Inc(ARect.Top, (ARect.Bottom - ARect.Top - NodeTextHeight) div 2);
|
||||||
//Now we are finally in a position to draw the text.
|
//Now we are finally in a position to draw the text.
|
||||||
TextOut(ARect.Left, ARect.Top, Node.Text);
|
TextOut(ARect.Left, ARect.Top, Node.Text);
|
||||||
end;
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user