Skip to content

Commit

Permalink
chore: use borders style from ctx
Browse files Browse the repository at this point in the history
  • Loading branch information
prgres committed May 17, 2024
1 parent cc1cbf0 commit 3534f56
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 35 deletions.
10 changes: 4 additions & 6 deletions ui/components/views-tabs/viewstabs.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,13 +136,11 @@ func (m Model) View() string {
borderMargin = 2
}

styleBorders := m.ctx.Style.Borders.Copy().
BorderForeground(bColor)

style := lipgloss.NewStyle().
BorderStyle(lipgloss.RoundedBorder()).
BorderForeground(bColor).
BorderBottom(m.ifBorders).
BorderRight(m.ifBorders).
BorderTop(m.ifBorders).
BorderLeft(m.ifBorders).
Inherit(styleBorders).
Height(1).
MaxHeight(1 + borderMargin).
Width(m.size.Width - borderMargin).
Expand Down
8 changes: 3 additions & 5 deletions ui/views/tasks/tasks.go
Original file line number Diff line number Diff line change
Expand Up @@ -290,12 +290,10 @@ func (m Model) View() string {
)
}

styleBorders := m.ctx.Style.Borders.Copy()

return lipgloss.NewStyle().
BorderStyle(lipgloss.RoundedBorder()).
BorderRight(m.ifBorders).
BorderBottom(m.ifBorders).
BorderTop(m.ifBorders).
BorderLeft(m.ifBorders).
Inherit(styleBorders).
Render(lipgloss.JoinVertical(
lipgloss.Top,
widgetViewsTabsRendered,
Expand Down
10 changes: 4 additions & 6 deletions ui/widgets/navigator/widget.go
Original file line number Diff line number Diff line change
Expand Up @@ -323,13 +323,11 @@ func (m Model) View() string {
borderMargin = 2
}

styleBorders := m.ctx.Style.Borders.Copy().
BorderForeground(bColor)

style := lipgloss.NewStyle().
BorderStyle(lipgloss.RoundedBorder()).
BorderForeground(bColor).
BorderBottom(m.ifBorders).
BorderRight(m.ifBorders).
BorderTop(m.ifBorders).
BorderLeft(m.ifBorders).
Inherit(styleBorders).
Width(m.size.Width - borderMargin).
MaxWidth(m.size.Width + borderMargin).
Height(m.size.Height - borderMargin).
Expand Down
10 changes: 4 additions & 6 deletions ui/widgets/tasks-sidebar/tasksidebar.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,13 +171,11 @@ func (m Model) View() string {
bColor = m.ctx.Theme.BordersColorActive
}

styleBorders := m.ctx.Style.Borders.Copy().
BorderForeground(bColor)

return lipgloss.NewStyle().
BorderStyle(lipgloss.RoundedBorder()).
BorderForeground(bColor).
BorderRight(m.ifBorders).
BorderBottom(m.ifBorders).
BorderTop(m.ifBorders).
BorderLeft(m.ifBorders).
Inherit(styleBorders).
Render(
m.viewport.View(),
)
Expand Down
10 changes: 4 additions & 6 deletions ui/widgets/tasks-table/taskstable.go
Original file line number Diff line number Diff line change
Expand Up @@ -248,13 +248,11 @@ func (m Model) View() string {
bColor = m.ctx.Theme.BordersColorActive
}

styleBorders := m.ctx.Style.Borders.Copy().
BorderForeground(bColor)

return lipgloss.NewStyle().
BorderStyle(lipgloss.RoundedBorder()).
BorderForeground(bColor).
BorderBottom(m.ifBorders).
BorderRight(m.ifBorders).
BorderTop(m.ifBorders).
BorderLeft(m.ifBorders).
Inherit(styleBorders).
Render(
m.table.View(),
)
Expand Down
10 changes: 4 additions & 6 deletions ui/widgets/tasks-tabs/taskstabs.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,13 +131,11 @@ func (m Model) View() string {
bColor = m.ctx.Theme.BordersColorActive
}

styleBorders := m.ctx.Style.Borders.Copy().
BorderForeground(bColor)

return lipgloss.NewStyle().
BorderStyle(lipgloss.RoundedBorder()).
BorderForeground(bColor).
BorderRight(true).
BorderBottom(true).
BorderTop(true).
BorderLeft(true).
Inherit(styleBorders).
Render(
s.String(),
)
Expand Down

0 comments on commit 3534f56

Please sign in to comment.