1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-08 11:38:21 +02:00

Documentation scroll fixes

This commit is contained in:
Brian Fiete 2025-06-02 07:50:31 +02:00
parent c53c7b4157
commit fafd6a7550
3 changed files with 78 additions and 53 deletions

View file

@ -155,9 +155,17 @@ namespace IDE.ui
curDocStr = new String(pragma, Math.Min(splitEnum.MatchPos + 1, pragma.Length)); curDocStr = new String(pragma, Math.Min(splitEnum.MatchPos + 1, pragma.Length));
curDocStr.Trim(); curDocStr.Trim();
mParamInfo[new String(paramName)] = curDocStr; if (mParamInfo.TryAddAlt(paramName, var keyPtr, var valuePtr))
{
*keyPtr = new String(paramName);
*valuePtr = curDocStr;
lineHadContent = true; lineHadContent = true;
} }
else
{
defer:: delete curDocStr;
}
}
} }
else if (pragmaName == "brief") else if (pragmaName == "brief")
{ {

View file

@ -411,6 +411,9 @@ namespace IDE.ui
return; return;
} }
if ((!mListViews.IsEmpty) && (mListViews[0].mVertScrollbar != null))
return;
if (evt.mSender != mWidgetWindow) if (evt.mSender != mWidgetWindow)
{ {
var widgetWindow = evt.mSender as BFWindow; var widgetWindow = evt.mSender as BFWindow;
@ -1195,6 +1198,8 @@ namespace IDE.ui
float height = childHeights + GS!(6); float height = childHeights + GS!(6);
float maxHeight = font.GetLineSpacing() * 12 + 6.001f; float maxHeight = font.GetLineSpacing() * 12 + 6.001f;
void CheckScrollbar()
{
if (height > maxHeight) if (height > maxHeight)
{ {
if (listView.mVertScrollbar == null) if (listView.mVertScrollbar == null)
@ -1206,6 +1211,8 @@ namespace IDE.ui
HandleEditLostFocus(mEditWidget); HandleEditLostFocus(mEditWidget);
}); });
var thumb = listView.mVertScrollbar.mThumb; var thumb = listView.mVertScrollbar.mThumb;
if (!wantWordWrap)
{
thumb.mOnDrag.Add(new (deltaX, deltaY) => thumb.mOnDrag.Add(new (deltaX, deltaY) =>
{ {
// Only allow size to grow between what it is current at and what we want it to be at. // Only allow size to grow between what it is current at and what we want it to be at.
@ -1247,9 +1254,12 @@ namespace IDE.ui
} }
}); });
} }
}
height = maxHeight; height = maxHeight;
wantWidth += GS!(20); wantWidth += GS!(20);
} }
}
CheckScrollbar();
int workspaceX; int workspaceX;
int workspaceY; int workspaceY;
@ -1273,6 +1283,9 @@ namespace IDE.ui
maxWidth = Math.Min(maxWidth, mTextPanel.mWidgetWindow.mWindowWidth); maxWidth = Math.Min(maxWidth, mTextPanel.mWidgetWindow.mWindowWidth);
} }
if (wantWordWrap)
maxWidth -= GS!(20);
var useWidth = Math.Min(wantWidth, maxWidth); var useWidth = Math.Min(wantWidth, maxWidth);
if (!listView.mIsReversed) if (!listView.mIsReversed)
@ -1318,6 +1331,10 @@ namespace IDE.ui
useWidth = actualMaxWidth + GS!(32); useWidth = actualMaxWidth + GS!(32);
listView.mColumns[0].mWidth = useWidth - GS!(2); listView.mColumns[0].mWidth = useWidth - GS!(2);
CheckScrollbar();
if (listView.mVertScrollbar != null)
useWidth += GS!(20);
} }
height += GS!(2); height += GS!(2);

View file

@ -5678,7 +5678,7 @@ namespace IDE.ui
} }
// Display all parameters on hover // Display all parameters on hover
if (docParser.mParamInfo.Count > 0) if (docParser.mParamInfo?.Count > 0)
{ {
debugExpr.Append("\n"); debugExpr.Append("\n");
debugExpr.Append("Parameters:"); debugExpr.Append("Parameters:");