mirror of
https://github.com/taigrr/wtf
synced 2025-01-18 04:03:14 -08:00
Add a focusable over-ride setting for widgets that are non-focusable by
default
For widgets that are non-focusable by default, you can now specify
focusable: true
in their config to over-ride the default 'false' value.
This commit is contained in:
@@ -23,7 +23,9 @@ type Base struct {
|
||||
enabledMutex *sync.Mutex
|
||||
}
|
||||
|
||||
func NewBase(app *tview.Application, commonSettings *cfg.Common, focusable bool) Base {
|
||||
func NewBase(app *tview.Application, commonSettings *cfg.Common, defaultFocusable bool) Base {
|
||||
focusable := commonSettings.Focusable || defaultFocusable
|
||||
|
||||
base := Base{
|
||||
commonSettings: commonSettings,
|
||||
app: app,
|
||||
|
||||
@@ -13,9 +13,9 @@ type TextWidget struct {
|
||||
}
|
||||
|
||||
// NewTextWidget creates and returns an instance of TextWidget
|
||||
func NewTextWidget(app *tview.Application, commonSettings *cfg.Common, focusable bool) TextWidget {
|
||||
func NewTextWidget(app *tview.Application, commonSettings *cfg.Common, defaultFocusable bool) TextWidget {
|
||||
widget := TextWidget{
|
||||
Base: NewBase(app, commonSettings, focusable),
|
||||
Base: NewBase(app, commonSettings, defaultFocusable),
|
||||
}
|
||||
|
||||
widget.View = widget.createView(widget.bordered)
|
||||
|
||||
Reference in New Issue
Block a user