mirror of
https://github.com/bcicen/ctop.git
synced 2024-08-30 18:23:19 +00:00
include block positioning in menu item drawing
This commit is contained in:
parent
93db38d654
commit
9b483ba2f3
@ -79,7 +79,8 @@ func (m *Menu) Buffer() ui.Buffer {
|
|||||||
buf := m.Block.Buffer()
|
buf := m.Block.Buffer()
|
||||||
|
|
||||||
for n, item := range m.items {
|
for n, item := range m.items {
|
||||||
x := m.padding[0]
|
x := m.X + m.padding[0]
|
||||||
|
y := m.Y + m.padding[1]
|
||||||
for _, ch := range item.Text() {
|
for _, ch := range item.Text() {
|
||||||
// invert bg/fg colors on currently selected row
|
// invert bg/fg colors on currently selected row
|
||||||
if m.Selectable && n == m.cursorPos {
|
if m.Selectable && n == m.cursorPos {
|
||||||
@ -87,7 +88,7 @@ func (m *Menu) Buffer() ui.Buffer {
|
|||||||
} else {
|
} else {
|
||||||
cell = ui.Cell{Ch: ch, Fg: m.TextFgColor, Bg: m.TextBgColor}
|
cell = ui.Cell{Ch: ch, Fg: m.TextFgColor, Bg: m.TextBgColor}
|
||||||
}
|
}
|
||||||
buf.Set(x, n+m.padding[1], cell)
|
buf.Set(x, y+n, cell)
|
||||||
x++
|
x++
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user