mirror of
https://github.com/zoriya/bubbles.git
synced 2026-08-05 12:46:14 +00:00
fix(table): substract headers Y size from the total table size (#434)
* fix(table): substract headers Y size from the total table size * fix: change GetFrameSize to GetVerticalFrameSize and calc header height * fix: remove GetVerticalFrameSize at all * fix: account for headers in height WithHeight, SetHeight --------- Co-authored-by: Maas Lalani <maas@lalani.dev>
This commit is contained in:
co-authored by
Maas Lalani
parent
961c081347
commit
6dbfc8284d
+2
-2
@@ -163,7 +163,7 @@ func WithRows(rows []Row) Option {
|
||||
// WithHeight sets the height of the table.
|
||||
func WithHeight(h int) Option {
|
||||
return func(m *Model) {
|
||||
m.viewport.Height = h
|
||||
m.viewport.Height = h - lipgloss.Height(m.headersView())
|
||||
}
|
||||
}
|
||||
|
||||
@@ -314,7 +314,7 @@ func (m *Model) SetWidth(w int) {
|
||||
|
||||
// SetHeight sets the height of the viewport of the table.
|
||||
func (m *Model) SetHeight(h int) {
|
||||
m.viewport.Height = h
|
||||
m.viewport.Height = h - lipgloss.Height(m.headersView())
|
||||
m.UpdateViewport()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user