From 0424c49035d35d9bc8ec9c64e834ff9fefd2d1ad Mon Sep 17 00:00:00 2001 From: Florrie Date: Thu, 18 Jul 2019 23:29:23 -0300 Subject: Fix layouting of context menus with scrollbars --- ui.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ui.js b/ui.js index c8d5363..a19c82d 100644 --- a/ui.js +++ b/ui.js @@ -2638,7 +2638,7 @@ class ContextMenu extends FocusElement { width += 2 // Space for the pane border height += 2 // Space for the pane border - if (this.form.scrollBarVisible) width++ + if (this.form.scrollBarShown) width++ this.w = width this.h = height @@ -2646,6 +2646,7 @@ class ContextMenu extends FocusElement { this.pane.fillParent() this.form.fillParent() + this.form.fixLayout() // After everything else, do a second pass to apply the decided width // to every element, so that they expand to all be the same width. @@ -2655,7 +2656,7 @@ class ContextMenu extends FocusElement { input.fixLayout() if (input.text) { const inputWidth = ansi.measureColumns(input.text) - if (inputWidth < width) { + if (inputWidth < this.form.contentW) { input.text += ' '.repeat(this.form.contentW - inputWidth) } } -- cgit 1.3.0-6-gf8a5