mirror of
https://github.com/taigrr/bubbletea.git
synced 2026-04-02 02:59:09 -07:00
fix: use more bulletproof GetFrameSize() list examples
This commit is contained in:
@@ -34,8 +34,8 @@ func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
|
||||
return m, tea.Quit
|
||||
}
|
||||
case tea.WindowSizeMsg:
|
||||
top, right, bottom, left := docStyle.GetMargin()
|
||||
m.list.SetSize(msg.Width-left-right, msg.Height-top-bottom)
|
||||
h, v := docStyle.GetFrameSize()
|
||||
m.list.SetSize(msg.Width-h, msg.Height-v)
|
||||
}
|
||||
|
||||
var cmd tea.Cmd
|
||||
|
||||
@@ -126,8 +126,8 @@ func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
|
||||
|
||||
switch msg := msg.(type) {
|
||||
case tea.WindowSizeMsg:
|
||||
topGap, rightGap, bottomGap, leftGap := appStyle.GetPadding()
|
||||
m.list.SetSize(msg.Width-leftGap-rightGap, msg.Height-topGap-bottomGap)
|
||||
h, v := appStyle.GetFrameSize()
|
||||
m.list.SetSize(msg.Width-h, msg.Height-v)
|
||||
|
||||
case tea.KeyMsg:
|
||||
// Don't match any of the keys below if we're actively filtering.
|
||||
|
||||
Reference in New Issue
Block a user