From e804876934a16ff18245a0b15571a883911b5cd3 Mon Sep 17 00:00:00 2001 From: Oliver <480930+rivo@users.noreply.github.com> Date: Thu, 7 Mar 2024 18:33:18 +0100 Subject: [PATCH] Drawing the Box in Modal, not in contained Frame. Fixes #946 --- modal.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/modal.go b/modal.go index 98ed4db..d12eb91 100644 --- a/modal.go +++ b/modal.go @@ -32,7 +32,7 @@ type Modal struct { // NewModal returns a new modal message window. func NewModal() *Modal { m := &Modal{ - Box: NewBox(), + Box: NewBox().SetBorder(true).SetBackgroundColor(Styles.ContrastBackgroundColor), textColor: Styles.PrimaryTextColor, } m.form = NewForm(). @@ -46,8 +46,7 @@ func NewModal() *Modal { } }) m.frame = NewFrame(m.form).SetBorders(0, 0, 1, 0, 0, 0) - m.frame.SetBorder(true). - SetBackgroundColor(Styles.ContrastBackgroundColor). + m.frame.SetBackgroundColor(Styles.ContrastBackgroundColor). SetBorderPadding(1, 1, 1, 1) return m } @@ -183,6 +182,8 @@ func (m *Modal) Draw(screen tcell.Screen) { m.SetRect(x, y, width, height) // Draw the frame. + m.Box.DrawForSubclass(screen, m) + x, y, width, height = m.GetInnerRect() m.frame.SetRect(x, y, width, height) m.frame.Draw(screen) }