From cc1063ebad12893c65b4f61fb114515abf9e5089 Mon Sep 17 00:00:00 2001 From: Vadim Lopatin Date: Fri, 22 Sep 2017 11:54:42 +0300 Subject: [PATCH] documentation popup scrollbars issue fix #313 --- src/dlangide/ui/dsourceedit.d | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/dlangide/ui/dsourceedit.d b/src/dlangide/ui/dsourceedit.d index 4958de1..d725a8b 100644 --- a/src/dlangide/ui/dsourceedit.d +++ b/src/dlangide/ui/dsourceedit.d @@ -529,20 +529,28 @@ class DSourceEdit : SourceEdit, EditableContentMarksChangeListener { //widget.text = "Test popup"d; //text.dup; widget.text = text.dup; + widget.hscrollbarMode = ScrollBarMode.Invisible; + widget.vscrollbarMode = ScrollBarMode.Invisible; Point bestSize = widget.fullContentSizeWithBorders(); + bestSize.x += 5.pointsToPixels; + //bestSize.y += 8.pointsToPixels; //widget.layoutHeight = lineCount * widget.fontSize; - if (bestSize.y > height / 3) + if (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.y += 30.pointsToPixels; + widget.hscrollbarMode = ScrollBarMode.Visible; + } widget.minHeight = bestSize.y; //max((lineCount + 1) * widget.fontSize, bestSize.y); widget.maxHeight = bestSize.y; widget.maxWidth = bestSize.x; //width * 3 / 4; widget.minWidth = bestSize.x; //width / 8; // widget.layoutWidth = width / 3; - widget.hscrollbarMode = ScrollBarMode.Auto; - widget.vscrollbarMode = ScrollBarMode.Auto; uint pos = PopupAlign.Above; if (pt.y < top + height / 4) pos = PopupAlign.Below;