documentation popup scrollbars issue fix #313

This commit is contained in:
Vadim Lopatin 2017-09-22 11:54:42 +03:00
parent 3011062621
commit cc1063ebad
1 changed files with 12 additions and 4 deletions

View File

@ -529,20 +529,28 @@ class DSourceEdit : SourceEdit, EditableContentMarksChangeListener {
//widget.text = "Test popup"d; //text.dup; //widget.text = "Test popup"d; //text.dup;
widget.text = text.dup; widget.text = text.dup;
widget.hscrollbarMode = ScrollBarMode.Invisible;
widget.vscrollbarMode = ScrollBarMode.Invisible;
Point bestSize = widget.fullContentSizeWithBorders(); Point bestSize = widget.fullContentSizeWithBorders();
bestSize.x += 5.pointsToPixels;
//bestSize.y += 8.pointsToPixels;
//widget.layoutHeight = lineCount * widget.fontSize; //widget.layoutHeight = lineCount * widget.fontSize;
if (bestSize.y > height / 3) if (bestSize.y > height / 3) {
bestSize.y = height / 3; bestSize.y = height / 3;
if (bestSize.x > width * 3 / 4) bestSize.x += 30.pointsToPixels;
widget.vscrollbarMode = ScrollBarMode.Visible;
}
if (bestSize.x > width * 3 / 4) {
bestSize.x = width * 3 / 4; bestSize.x = width * 3 / 4;
bestSize.y += 30.pointsToPixels;
widget.hscrollbarMode = ScrollBarMode.Visible;
}
widget.minHeight = bestSize.y; //max((lineCount + 1) * widget.fontSize, bestSize.y); widget.minHeight = bestSize.y; //max((lineCount + 1) * widget.fontSize, bestSize.y);
widget.maxHeight = bestSize.y; widget.maxHeight = bestSize.y;
widget.maxWidth = bestSize.x; //width * 3 / 4; widget.maxWidth = bestSize.x; //width * 3 / 4;
widget.minWidth = bestSize.x; //width / 8; widget.minWidth = bestSize.x; //width / 8;
// widget.layoutWidth = width / 3; // widget.layoutWidth = width / 3;
widget.hscrollbarMode = ScrollBarMode.Auto;
widget.vscrollbarMode = ScrollBarMode.Auto;
uint pos = PopupAlign.Above; uint pos = PopupAlign.Above;
if (pt.y < top + height / 4) if (pt.y < top + height / 4)
pos = PopupAlign.Below; pos = PopupAlign.Below;