« get me outta code hell

Dim selected non-playable when not focused - 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>2019-10-15 22:03:09 -0300
committerFlorrie <towerofnix@gmail.com>2019-10-15 22:03:09 -0300
commitcb4835e4eb3df8cfddfe33b94cc1afb202615acf (patch)
tree6b967c6570700b13db3dd85f5876d740890c071b
parent3a8c4c7dcacdd2f292f9b8d32b3fa88caca46f87 (diff)
Dim selected non-playable when not focused
-rw-r--r--ui.js7
1 files changed, 6 insertions, 1 deletions
diff --git a/ui.js b/ui.js
index a221b04..88b26af 100644
--- a/ui.js
+++ b/ui.js
@@ -2046,7 +2046,12 @@ class BasicGrouplikeItemElement extends Button {
     if (isSelfSelected) {
       writable.write(ansi.invert())
     } else if (isCurrentInput) {
-      writable.write(ansi.setAttributes([ansi.A_INVERT, ansi.A_DIM]))
+      // technically cheating - isPlayable is defined on InteractiveGrouplikeElement
+      if (this.isPlayable === false) {
+        writable.write(ansi.setAttributes([ansi.A_INVERT, ansi.C_BLACK, ansi.A_BRIGHT]))
+      } else {
+        writable.write(ansi.setAttributes([ansi.A_INVERT, ansi.A_DIM]))
+      }
     }
 
     writable.write(ansi.moveCursor(this.absTop, this.absLeft))