« 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.js13
1 files changed, 12 insertions, 1 deletions
diff --git a/ui.js b/ui.js
index 9d92229..a20fb52 100644
--- a/ui.js
+++ b/ui.js
@@ -11,6 +11,7 @@ const Label = require('./tui-lib/ui/Label')
 const ListScrollForm = require('./tui-lib/ui/form/ListScrollForm')
 const Pane = require('./tui-lib/ui/Pane')
 const RecordStore = require('./record-store')
+const WrapLabel = require('./tui-lib/ui/WrapLabel')
 const telc = require('./tui-lib/util/telchars')
 const unic = require('./tui-lib/util/unichars')
 
@@ -435,11 +436,19 @@ class GrouplikeListingElement extends FocusElement {
 
     this.pathElement = new PathElement()
     this.addChild(this.pathElement)
+
+    this.commentLabel = new WrapLabel()
+    this.addChild(this.commentLabel)
   }
 
   fixLayout() {
+    this.commentLabel.w = this.contentW
+
     this.form.w = this.contentW
-    this.form.h = this.contentH - 1
+    this.form.h = this.contentH
+    this.form.y = this.commentLabel.bottom
+    this.form.h -= this.commentLabel.h
+    this.form.h -= this.pathElement.h
 
     this.pathElement.y = this.contentH - 1
     this.pathElement.w = this.contentW
@@ -475,6 +484,8 @@ class GrouplikeListingElement extends FocusElement {
       throw new Error('Attempted to call buildItems before a grouplike was loaded')
     }
 
+    this.commentLabel.text = this.grouplike.comment || ''
+
     const wasSelected = this.isSelected
     const form = this.form