mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-10 12:32:20 +02:00
Better word wrapping for hoverwatch
This commit is contained in:
parent
9afa24e5d7
commit
76d997fca7
2 changed files with 6 additions and 1 deletions
|
@ -1257,6 +1257,8 @@ namespace IDE.ui
|
|||
|
||||
if ((wantWordWrap) && (useWidth < wantWidth))
|
||||
{
|
||||
float actualMaxWidth = 0;
|
||||
|
||||
for (WatchListViewItem listViewItem in listView.GetRoot().mChildItems)
|
||||
{
|
||||
if (listViewItem.mLabel == null)
|
||||
|
@ -1265,11 +1267,14 @@ namespace IDE.ui
|
|||
listView.mWordWrap = true;
|
||||
FontMetrics fontMetrics = .();
|
||||
float nameHeight = font.Draw(null, listViewItem.mLabel, 0, 0, -1, useWidth - GS!(32), FontOverflowMode.Wrap, &fontMetrics);
|
||||
actualMaxWidth = Math.Max(actualMaxWidth, fontMetrics.mMaxWidth);
|
||||
|
||||
float addHeight = nameHeight - listViewItem.mSelfHeight;
|
||||
height += addHeight;
|
||||
}
|
||||
|
||||
useWidth = actualMaxWidth + GS!(32);
|
||||
|
||||
listView.mColumns[0].mWidth = useWidth - GS!(2);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue