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:
@@ -5,7 +5,10 @@ import (
|
||||
"github.com/wtfutil/wtf/cfg"
|
||||
)
|
||||
|
||||
const defaultTitle = "Mercurial"
|
||||
const (
|
||||
defaultFocusable = true
|
||||
defaultTitle = "Mercurial"
|
||||
)
|
||||
|
||||
type Settings struct {
|
||||
common *cfg.Common
|
||||
@@ -18,7 +21,7 @@ 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]{rev}:{phase} [white]{desc|firstline|strip} [grey]{author|person} {date|age}[white]"),
|
||||
|
||||
@@ -7,9 +7,11 @@ import (
|
||||
"github.com/wtfutil/wtf/view"
|
||||
)
|
||||
|
||||
const offscreen = -1000
|
||||
const modalWidth = 80
|
||||
const modalHeight = 7
|
||||
const (
|
||||
modalHeight = 7
|
||||
modalWidth = 80
|
||||
offscreen = -1000
|
||||
)
|
||||
|
||||
// A Widget represents a Mercurial widget
|
||||
type Widget struct {
|
||||
@@ -28,7 +30,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