Merge pull request #269 from wedaly/master
Add functions to set background color, button text, and button background color on modal.merge-requests/1/merge
commit
cf9d115173
19
modal.go
19
modal.go
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue