Merge pull request #269 from wedaly/master

Add functions to set background color, button text, and button background color on modal.
This commit is contained in:
rivo 2019-05-14 18:34:53 +02:00 committed by GitHub
commit cf9d115173
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 19 additions and 0 deletions

View File

@ -53,12 +53,31 @@ func NewModal() *Modal {
return m
}
// SetBackgroundColor sets the color of the modal frame background.
func (m *Modal) SetBackgroundColor(color tcell.Color) *Modal {
m.form.SetBackgroundColor(color)
m.frame.SetBackgroundColor(color)
return m
}
// SetTextColor sets the color of the message text.
func (m *Modal) SetTextColor(color tcell.Color) *Modal {
m.textColor = color
return m
}
// SetButtonBackgroundColor sets the background color of the buttons.
func (m *Modal) SetButtonBackgroundColor(color tcell.Color) *Modal {
m.form.SetButtonBackgroundColor(color)
return m
}
// SetButtonTextColor sets the color of the button texts.
func (m *Modal) SetButtonTextColor(color tcell.Color) *Modal {
m.form.SetButtonTextColor(color)
return m
}
// SetDoneFunc sets a handler which is called when one of the buttons was
// pressed. It receives the index of the button as well as its label text. The
// handler is also called when the user presses the Escape key. The index will