[#1223] lens/tui: Add alternative text on open an empty bucket
Add an alternative text to display in the selected bucket's records view in case that bucket is empty. Signed-off-by: Aleksey Savchuk <a.savchuk@yadro.com>
This commit is contained in:
parent
4ed3b273f9
commit
f8ce4ea63a
1 changed files with 10 additions and 0 deletions
|
@ -138,6 +138,16 @@ func (v *RecordsView) Draw(screen tcell.Screen) {
|
|||
// }
|
||||
|
||||
v.DrawForSubclass(screen, v)
|
||||
|
||||
// No records in that bucket.
|
||||
if v.firstRecordIndex == v.lastRecordIndex {
|
||||
tview.Print(
|
||||
screen, "Empty Bucket", x, y+1, width,
|
||||
tview.AlignCenter, tview.Styles.PrimaryTextColor,
|
||||
)
|
||||
return
|
||||
}
|
||||
|
||||
for index := v.firstRecordIndex; index < v.lastRecordIndex; index++ {
|
||||
result := v.records[index].Entry
|
||||
text := result.String()
|
||||
|
|
Loading…
Reference in a new issue