Updates to drawing, additional props, friendly IP addrs, etc.

This commit is contained in:
Bryan Ashby
2022-06-10 16:08:22 -06:00
parent 1ba866f2ca
commit ba5775adc9
8 changed files with 59 additions and 9 deletions

View File

@@ -83,6 +83,15 @@ function VerticalMenuView(options) {
self.client.term.write(`${ansi.goto(item.row, self.position.col)}${text}`);
this.setRenderCacheItem(index, text, item.focused);
};
this.drawRemovedItem = function(index) {
if (index <= this.items.length - 1) {
return;
}
const row = this.position.row + index;
this.client.term.rawWrite(`${ansi.goto(row, this.position.col)}${ansi.normal()}${this.fillChar.repeat(this.dimens.width)}`)
};
}
util.inherits(VerticalMenuView, MenuView);
@@ -123,6 +132,11 @@ VerticalMenuView.prototype.redraw = function() {
this.drawItem(i);
}
}
const remain = Math.max(0, this.dimens.height - this.items.length);
for (let i = this.items.length; i < remain; ++i) {
this.drawRemovedItem(i);
}
};
VerticalMenuView.prototype.setHeight = function(height) {