« get me outta code hell

mtui - Music Text User Interface - user-friendly command line music player
about summary refs log tree commit diff
path: root/ui.js
diff options
context:
space:
mode:
Diffstat (limited to 'ui.js')
-rw-r--r--ui.js5
1 files 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)
         }
       }