« get me outta code hell

Keep selected track/group visible when resizing - 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-09-17 13:28:08 -0300
committerFlorrie <towerofnix@gmail.com>2019-09-17 13:28:08 -0300
commitca52191a803879a64c262d7aa5c002d5d374b0a2 (patch)
tree03b7513759a95728f3a8d28eb5ad8a76090854e7
parent376d169962e8080651b93adc9405901d8f601b4c (diff)
Keep selected track/group visible when resizing
-rw-r--r--todo.txt1
-rw-r--r--ui.js1
2 files changed, 2 insertions, 0 deletions
diff --git a/todo.txt b/todo.txt
index c51c269..641f892 100644
--- a/todo.txt
+++ b/todo.txt
@@ -336,6 +336,7 @@ TODO: Default to 'after selected track' in context menu, and make pressing Q
 
 TODO: When grouplike listings are fixLayout'd (e.g. the window is resized),
       make sure the selected input is still visible!
+      (Done!)
 
 TODO: If you press any key which should select a particular element of the UI
       (e.g. the menubar) while a context menu is open, currently the context
diff --git a/ui.js b/ui.js
index a3860e9..f654ef8 100644
--- a/ui.js
+++ b/ui.js
@@ -1185,6 +1185,7 @@ class GrouplikeListingElement extends Form {
     if (this.jumpElement.visible) this.form.h -= 1
 
     this.form.fixLayout() // Respond to being resized
+    this.form.scrollSelectedElementIntoView()
 
     this.pathElement.y = this.contentH - 1
     this.pathElement.w = this.contentW