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,8 +155,16 @@ 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))
lineHadContent = true; {
*keyPtr = new String(paramName);
*valuePtr = curDocStr;
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,61 +1198,68 @@ 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;
if (height > maxHeight) void CheckScrollbar()
{ {
if (listView.mVertScrollbar == null) if (height > maxHeight)
{ {
listView.InitScrollbars(false, true); if (listView.mVertScrollbar == null)
listView.mVertScrollbar.mOnScrollEvent.Add(new (dlg) => {
listView.InitScrollbars(false, true);
listView.mVertScrollbar.mOnScrollEvent.Add(new (dlg) =>
{
if (mEditWidget != null)
HandleEditLostFocus(mEditWidget);
});
var thumb = listView.mVertScrollbar.mThumb;
if (!wantWordWrap)
{ {
if (mEditWidget != null) thumb.mOnDrag.Add(new (deltaX, deltaY) =>
HandleEditLostFocus(mEditWidget); {
}); // Only allow size to grow between what it is current at and what we want it to be at.
var thumb = listView.mVertScrollbar.mThumb; // For exactly-sized scroll areas this means it wouldn't change at all.
thumb.mOnDrag.Add(new (deltaX, deltaY) => /*float haveWidth = listView.mWidth;
{ float setWidth = listView.mWidth + parentX;
// Only allow size to grow between what it is current at and what we want it to be at. float wantWidth = listView.mColumns[0].mWidth + listView.mColumns[1].mWidth + GS!(26);
// For exactly-sized scroll areas this means it wouldn't change at all. if (haveWidth < wantWidth)
/*float haveWidth = listView.mWidth; setWidth = Math.Max(haveWidth, Math.Min(setWidth, wantWidth));
float setWidth = listView.mWidth + parentX; else
float wantWidth = listView.mColumns[0].mWidth + listView.mColumns[1].mWidth + GS!(26); setWidth = Math.Min(haveWidth, Math.Max(setWidth, wantWidth));*/
if (haveWidth < wantWidth)
setWidth = Math.Max(haveWidth, Math.Min(setWidth, wantWidth));
else
setWidth = Math.Min(haveWidth, Math.Max(setWidth, wantWidth));*/
float setWidth = listView.mWidth; float setWidth = listView.mWidth;
float thumbX = thumb.mDraggableHelper.mMouseX; float thumbX = thumb.mDraggableHelper.mMouseX;
if (thumbX < 0) if (thumbX < 0)
{ {
float transX; float transX;
float transY; float transY;
thumb.SelfToOtherTranslate(listView, thumbX, 0, out transX, out transY); thumb.SelfToOtherTranslate(listView, thumbX, 0, out transX, out transY);
setWidth = transX + thumb.mWidth; setWidth = transX + thumb.mWidth;
} }
else if (thumbX > thumb.mWidth) else if (thumbX > thumb.mWidth)
{ {
float wantWidth = listView.mColumns[0].mWidth + listView.mColumns[1].mWidth + GS!(26); float wantWidth = listView.mColumns[0].mWidth + listView.mColumns[1].mWidth + GS!(26);
float transX; float transX;
float transY; float transY;
thumb.SelfToOtherTranslate(listView, thumbX, 0, out transX, out transY); thumb.SelfToOtherTranslate(listView, thumbX, 0, out transX, out transY);
setWidth = Math.Min(transX, wantWidth); setWidth = Math.Min(transX, wantWidth);
setWidth = Math.Max(setWidth, listView.mWidth); setWidth = Math.Max(setWidth, listView.mWidth);
} }
setWidth = Math.Max(setWidth, listView.mColumns[0].mWidth + GS!(64)); setWidth = Math.Max(setWidth, listView.mColumns[0].mWidth + GS!(64));
if (setWidth != listView.mWidth) if (setWidth != listView.mWidth)
{ {
listView.Resize(listView.mX, listView.mY, setWidth, listView.mHeight); listView.Resize(listView.mX, listView.mY, setWidth, listView.mHeight);
ResizeWindow(); ResizeWindow();
} }
}); });
} }
height = maxHeight; }
wantWidth += GS!(20); height = maxHeight;
} 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:");