Skip to content

Commit

Permalink
Removed use of deprecated Copy
Browse files Browse the repository at this point in the history
  • Loading branch information
arianizadi authored and meowgorithm committed Jun 3, 2024
1 parent eb78a8c commit 2d65ed6
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion examples/pager/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ var (
infoStyle = func() lipgloss.Style {
b := lipgloss.RoundedBorder()
b.Left = "┤"
return titleStyle.Copy().BorderStyle(b)
return titleStyle.BorderStyle(b)
}()
)

Expand Down
4 changes: 2 additions & 2 deletions examples/send-msg/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ import (
var (
spinnerStyle = lipgloss.NewStyle().Foreground(lipgloss.Color("63"))
helpStyle = lipgloss.NewStyle().Foreground(lipgloss.Color("241")).Margin(1, 0)
dotStyle = helpStyle.Copy().UnsetMargins()
durationStyle = dotStyle.Copy()
dotStyle = helpStyle.UnsetMargins()
durationStyle = dotStyle
appStyle = lipgloss.NewStyle().Margin(1, 2, 0, 2)
)

Expand Down
10 changes: 5 additions & 5 deletions examples/table-resize/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ func (m model) View() string {
func main() {
re := lipgloss.NewRenderer(os.Stdout)
baseStyle := re.NewStyle().Padding(0, 1)
headerStyle := baseStyle.Copy().Foreground(lipgloss.Color("252")).Bold(true)
selectedStyle := baseStyle.Copy().Foreground(lipgloss.Color("#01BE85")).Background(lipgloss.Color("#00432F"))
headerStyle := baseStyle.Foreground(lipgloss.Color("252")).Bold(true)
selectedStyle := baseStyle.Foreground(lipgloss.Color("#01BE85")).Background(lipgloss.Color("#00432F"))
typeColors := map[string]lipgloss.Color{
"Bug": lipgloss.Color("#D7FF87"),
"Electric": lipgloss.Color("#FDFF90"),
Expand Down Expand Up @@ -118,13 +118,13 @@ func main() {
}

color := c[fmt.Sprint(rows[row-1][col])]
return baseStyle.Copy().Foreground(color)
return baseStyle.Foreground(color)
}

if even {
return baseStyle.Copy().Foreground(lipgloss.Color("245"))
return baseStyle.Foreground(lipgloss.Color("245"))
}
return baseStyle.Copy().Foreground(lipgloss.Color("252"))
return baseStyle.Foreground(lipgloss.Color("252"))
}).
Border(lipgloss.ThickBorder())

Expand Down
6 changes: 3 additions & 3 deletions examples/tabs/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ var (
docStyle = lipgloss.NewStyle().Padding(1, 2, 1, 2)
highlightColor = lipgloss.AdaptiveColor{Light: "#874BFD", Dark: "#7D56F4"}
inactiveTabStyle = lipgloss.NewStyle().Border(inactiveTabBorder, true).BorderForeground(highlightColor).Padding(0, 1)
activeTabStyle = inactiveTabStyle.Copy().Border(activeTabBorder, true)
activeTabStyle = inactiveTabStyle.Border(activeTabBorder, true)
windowStyle = lipgloss.NewStyle().BorderForeground(highlightColor).Padding(2, 0).Align(lipgloss.Center).Border(lipgloss.NormalBorder()).UnsetBorderTop()
)

Expand All @@ -64,9 +64,9 @@ func (m model) View() string {
var style lipgloss.Style
isFirst, isLast, isActive := i == 0, i == len(m.Tabs)-1, i == m.activeTab
if isActive {
style = activeTabStyle.Copy()
style = activeTabStyle
} else {
style = inactiveTabStyle.Copy()
style = inactiveTabStyle
}
border, _, _, _, _ := style.GetBorder()
if isFirst && isActive {
Expand Down
6 changes: 3 additions & 3 deletions examples/textinputs/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ import (
var (
focusedStyle = lipgloss.NewStyle().Foreground(lipgloss.Color("205"))
blurredStyle = lipgloss.NewStyle().Foreground(lipgloss.Color("240"))
cursorStyle = focusedStyle.Copy()
cursorStyle = focusedStyle
noStyle = lipgloss.NewStyle()
helpStyle = blurredStyle.Copy()
helpStyle = blurredStyle
cursorModeHelpStyle = lipgloss.NewStyle().Foreground(lipgloss.Color("244"))

focusedButton = focusedStyle.Copy().Render("[ Submit ]")
focusedButton = focusedStyle.Render("[ Submit ]")
blurredButton = fmt.Sprintf("[ %s ]", blurredStyle.Render("Submit"))
)

Expand Down

0 comments on commit 2d65ed6

Please sign in to comment.