Skip to content

Commit

Permalink
Changed in the height of the list.
Browse files Browse the repository at this point in the history
Still broken when filtering (related to the itemDelegate and the simple list)
  • Loading branch information
ariasmn committed Jul 21, 2022
1 parent 0228af0 commit 108a9ae
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion internal/tui/common/styles.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ var (
Width(35).
PaddingRight(3).
MarginRight(3).
Border(lipgloss.RoundedBorder(), false, true, false, false)
Border(lipgloss.RoundedBorder())
ListColorStyle = lipgloss.NewStyle().
Background(lipgloss.Color("#3d719c"))
ListItemStyle = lipgloss.NewStyle().
Expand Down
4 changes: 3 additions & 1 deletion internal/tui/group/update.go
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
package group

import (
"github.com/ariasmn/ugm/internal/tui/common"
"github.com/charmbracelet/bubbles/viewport"
tea "github.com/charmbracelet/bubbletea"
)

func (bg BubbleGroup) Update (msg tea.Msg) (BubbleGroup, tea.Cmd) {
switch msg := msg.(type) {
case tea.WindowSizeMsg:
bg.list.SetSize(msg.Width, msg.Height)
h, v := common.ListStyle.GetFrameSize()
bg.list.SetSize(msg.Width-h, msg.Height-v)
bg.viewport = viewport.New(msg.Width, msg.Height)
bg.viewport.SetContent(bg.detailView())
}
Expand Down
4 changes: 3 additions & 1 deletion internal/tui/user/update.go
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
package user

import (
"github.com/ariasmn/ugm/internal/tui/common"
"github.com/charmbracelet/bubbles/viewport"
tea "github.com/charmbracelet/bubbletea"
)

func (bu BubbleUser) Update(msg tea.Msg) (BubbleUser, tea.Cmd) {
switch msg := msg.(type) {
case tea.WindowSizeMsg:
bu.list.SetSize(msg.Width, msg.Height)
h, v := common.ListStyle.GetFrameSize()
bu.list.SetSize(msg.Width-h, msg.Height-v)
bu.viewport = viewport.New(msg.Width, msg.Height)
bu.viewport.SetContent(bu.detailView())
}
Expand Down

0 comments on commit 108a9ae

Please sign in to comment.