Removed one-cycle border removal for buttons as it does not work as intended. Fixes #1012

This commit is contained in:
Oliver 2024-07-28 13:49:35 +02:00
parent b0a7293b81
commit 65571ae51e
1 changed files with 1 additions and 9 deletions

View File

@ -136,18 +136,10 @@ func (b *Button) Draw(screen tcell.Screen) {
if b.disabled { if b.disabled {
style = b.disabledStyle style = b.disabledStyle
} }
_, backgroundColor, _ := style.Decompose()
if b.HasFocus() && !b.disabled { if b.HasFocus() && !b.disabled {
style = b.activatedStyle 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.SetBackgroundColor(backgroundColor)
b.Box.DrawForSubclass(screen, b) b.Box.DrawForSubclass(screen, b)