Adding scrolling for peer list

This commit is contained in:
raven 2023-01-15 22:14:24 -05:00
parent 308c3c210b
commit f9c2f44d2e
1 changed files with 20 additions and 7 deletions

View File

@ -72,6 +72,12 @@ screen.key(['t', 'enter'], function (ch, key) {
stdinBox.focus();
});
// Return to chat
screen.key(['p', 'enter'], function (ch, key) {
sidebarBox.focus();
});
// Debug ONLY
// screen.on('keypress', function(ch, key){
// console.log(JSON.stringify(key));
@ -126,22 +132,29 @@ const stdinBox = blessed.textbox({
input: true
});
// Create the sidebar box for connected peers
const sidebarBox = blessed.box({
let sidebarBox = blessed.box({
parent: screen,
top: '0',
right: '0',
width: '20%',
height: '100%',
content: '',
border: {
type: 'line'
},
style: {
fg: 'white',
bg: 'black',
border: {
fg: '#f0f0f0'
},
bg: 'black'
},
keys: true,
vi: true,
alwaysScroll: true,
scrollable: true,
scrollbar: {
style: {
bg: 'yellow'
}
}
});