« get me outta code hell

mtui - Music Text User Interface - user-friendly command line music player
about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ui.js9
1 files changed, 8 insertions, 1 deletions
diff --git a/ui.js b/ui.js
index 6562139..3bac8c6 100644
--- a/ui.js
+++ b/ui.js
@@ -247,6 +247,12 @@ class AppElement extends FocusElement {
 
     this.log = new Log()
     this.logPane.addChild(this.log)
+    this.logPane.visible = false
+
+    this.log.on('log-message', () => {
+      this.logPane.visible = true
+      this.fixLayout()
+    })
 
     if (!this.config.showTabberPane) {
       this.tabberPane.visible = false
@@ -1264,7 +1270,7 @@ class AppElement extends FocusElement {
       this.logPane.w = leftWidth
       this.logPane.h = 6
       this.log.fillParent()
-      this.log.fixLayout()
+      this.log.fixAllLayout()
     }
 
     if (this.tabberPane.visible) {
@@ -4413,6 +4419,7 @@ class Log extends ListScrollForm {
     this.addInput(logMessage)
     this.fixLayout()
     this.scrollToEnd()
+    this.emit('log-message', logMessage)
     return logMessage
   }
 }