Skip to content

Commit

Permalink
Removed one-cycle border removal for buttons as it does not work as i…
Browse files Browse the repository at this point in the history
…ntended. Fixes rivo#1012
  • Loading branch information
rivo authored and kopecmaciej committed Aug 27, 2024
1 parent 88acacb commit 6bd9ae4
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions button.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,18 136,10 @@ func (b *Button) Draw(screen tcell.Screen) {
if b.disabled {
style = b.disabledStyle
}
_, backgroundColor, _ := style.Decompose()
if b.HasFocus() && !b.disabled {
style = b.activatedStyle
_, backgroundColor, _ = style.Decompose()

// Highlight button for one drawing cycle.
borderColor := b.GetBorderColor()
b.SetBorderColor(backgroundColor)
defer func() {
b.SetBorderColor(borderColor)
}()
}
_, backgroundColor, _ := style.Decompose()
b.SetBackgroundColor(backgroundColor)
b.Box.DrawForSubclass(screen, b)

Expand Down

0 comments on commit 6bd9ae4

Please sign in to comment.