« get me outta code hell

Downloader-arg label ('from: url') - mtui - Music Text User Interface - user-friendly command line music player
about summary refs log tree commit diff
diff options
context:
space:
mode:
authorFlorrie <towerofnix@gmail.com>2018-06-02 23:28:46 -0300
committerFlorrie <towerofnix@gmail.com>2018-06-02 23:28:46 -0300
commit662ab7324567e093ff432991cefbd3293a68cea6 (patch)
treeb649adfa1ba858e7bd636792bf3be28f23844492
parentb2de4602d9b8c287a6da847e42131900d3606f7b (diff)
Downloader-arg label ('from: url')
-rw-r--r--ui.js8
1 files changed, 7 insertions, 1 deletions
diff --git a/ui.js b/ui.js
index 5ff4cba..5177aed 100644
--- a/ui.js
+++ b/ui.js
@@ -81,7 +81,7 @@ class AppElement extends FocusElement {
     this.h = this.parent.contentH
 
     this.paneLeft.w = Math.max(Math.floor(0.8 * this.contentW), this.contentW - 80)
-    this.paneLeft.h = this.contentH - 4
+    this.paneLeft.h = this.contentH - 5
     this.paneRight.x = this.paneLeft.right
     this.paneRight.w = this.contentW - this.paneLeft.right
     this.paneRight.h = this.paneLeft.h
@@ -468,16 +468,21 @@ class PlaybackInfoElement extends DisplayElement {
 
     this.trackNameLabel = new Label('')
     this.addChild(this.trackNameLabel)
+
+    this.downloadLabel = new Label('')
+    this.addChild(this.downloadLabel)
   }
 
   fixLayout() {
     const centerX = el => el.x = Math.round((this.w - el.w) / 2)
     centerX(this.progressTextLabel)
     centerX(this.trackNameLabel)
+    centerX(this.downloadLabel)
 
     this.trackNameLabel.y = 0
     this.progressBarLabel.y = 1
     this.progressTextLabel.y = this.progressBarLabel.y
+    this.downloadLabel.y = 2
   }
 
   updateProgress({timeDone, timeLeft, duration, lenSecTotal, curSecTotal}) {
@@ -488,6 +493,7 @@ class PlaybackInfoElement extends DisplayElement {
 
   updateTrack(track) {
     this.trackNameLabel.text = track.name
+    this.downloadLabel.text = `(From: ${track.downloaderArg})`
     this.fixLayout()
   }
 }