mirror of
https://github.com/taigrr/wtf
synced 2025-01-18 04:03:14 -08:00
Constantize the defaultFocus value for each module
This commit is contained in:
@@ -6,7 +6,10 @@ import (
|
||||
"github.com/wtfutil/wtf/utils"
|
||||
)
|
||||
|
||||
const defaultTitle = "Git"
|
||||
const (
|
||||
defaultFocusable = true
|
||||
defaultTitle = "Git"
|
||||
)
|
||||
|
||||
type Settings struct {
|
||||
common *cfg.Common
|
||||
@@ -18,9 +21,8 @@ type Settings struct {
|
||||
}
|
||||
|
||||
func NewSettingsFromYAML(name string, ymlConfig *config.Config, globalConfig *config.Config) *Settings {
|
||||
|
||||
settings := Settings{
|
||||
common: cfg.NewCommonSettingsFromModule(name, defaultTitle, ymlConfig, globalConfig),
|
||||
common: cfg.NewCommonSettingsFromModule(name, defaultTitle, defaultFocusable, ymlConfig, globalConfig),
|
||||
|
||||
commitCount: ymlConfig.UInt("commitCount", 10),
|
||||
commitFormat: ymlConfig.UString("commitFormat", "[forestgreen]%h [white]%s [grey]%an on %cd[white]"),
|
||||
|
||||
@@ -11,9 +11,11 @@ import (
|
||||
"github.com/wtfutil/wtf/view"
|
||||
)
|
||||
|
||||
const offscreen = -1000
|
||||
const modalWidth = 80
|
||||
const modalHeight = 7
|
||||
const (
|
||||
modalHeight = 7
|
||||
modalWidth = 80
|
||||
offscreen = -1000
|
||||
)
|
||||
|
||||
type Widget struct {
|
||||
view.KeyboardWidget
|
||||
@@ -31,7 +33,7 @@ func NewWidget(app *tview.Application, pages *tview.Pages, settings *Settings) *
|
||||
widget := Widget{
|
||||
KeyboardWidget: view.NewKeyboardWidget(app, pages, settings.common),
|
||||
MultiSourceWidget: view.NewMultiSourceWidget(settings.common, "repository", "repositories"),
|
||||
TextWidget: view.NewTextWidget(app, settings.common, true),
|
||||
TextWidget: view.NewTextWidget(app, settings.common),
|
||||
|
||||
app: app,
|
||||
pages: pages,
|
||||
|
||||
Reference in New Issue
Block a user