Remove wrapper methods
parent
e1cd3be7bb
commit
db81e43e00
|
@ -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()
|
||||
|
|
|
@ -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)
|
||||
})
|
||||
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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()
|
||||
|
|
Loading…
Reference in New Issue