Remove wrapper methods

This commit is contained in:
Trevor Slocum 2020-10-02 16:28:32 -07:00
parent e1cd3be7bb
commit db81e43e00
5 changed files with 5 additions and 20 deletions

View File

@ -145,12 +145,6 @@ func (c *CheckBox) SetLabelWidth(width int) *CheckBox {
return c
}
// SetBackgroundColor sets the background color.
func (c *CheckBox) SetBackgroundColor(color tcell.Color) *CheckBox {
c.Box.SetBackgroundColor(color)
return c
}
// SetLabelColor sets the color of the label.
func (c *CheckBox) SetLabelColor(color tcell.Color) *CheckBox {
c.Lock()

View File

@ -13,7 +13,7 @@ type ContextMenu struct {
x, y int
selected func(int, string, rune)
l sync.Mutex
l sync.RWMutex
}
// NewContextMenu returns a new context menu.
@ -159,6 +159,9 @@ func (c *ContextMenu) show(item int, x int, y int, setFocus func(Primitive)) {
c.l.Unlock()
}
}).SetDoneFunc(func() {
c.l.Lock()
defer c.l.Unlock()
c.hide(setFocus)
})

View File

@ -25,7 +25,7 @@ func main() {
})
// Set up autocomplete function.
var mutex sync.Mutex
var mutex sync.RWMutex
prefixMap := make(map[string][]*cview.ListItem)
inputField.SetAutocompleteFunc(func(currentText string) []*cview.ListItem {
// Ignore empty text.

View File

@ -273,12 +273,6 @@ func (d *DropDown) SetLabelWidth(width int) *DropDown {
return d
}
// SetBackgroundColor sets the background color.
func (d *DropDown) SetBackgroundColor(color tcell.Color) *DropDown {
d.Box.SetBackgroundColor(color)
return d
}
// SetLabelColor sets the color of the label.
func (d *DropDown) SetLabelColor(color tcell.Color) *DropDown {
d.Lock()

View File

@ -210,12 +210,6 @@ func (i *InputField) SetLabelWidth(width int) *InputField {
return i
}
// SetBackgroundColor sets the background color.
func (i *InputField) SetBackgroundColor(color tcell.Color) *InputField {
i.Box.SetBackgroundColor(color)
return i
}
// SetPlaceholder sets the text to be displayed when the input text is empty.
func (i *InputField) SetPlaceholder(text string) *InputField {
i.Lock()