aboutsummaryrefslogtreecommitdiffstats
path: root/widgets
diff options
context:
space:
mode:
authorMoritz Poldrack <git@moritz.sh>2022-03-18 09:53:02 +0100
committerRobin Jarry <robin@jarry.cc>2022-03-18 13:33:16 +0100
commite30bd324a3552fae3089110d39b61ddced66ddee (patch)
treec1d3ea03094f6781c082b627f04398909ae15234 /widgets
parent62a5ebb1e19aeb36f8451510bc03d5dbe986fb04 (diff)
downloadaerc-e30bd324a3552fae3089110d39b61ddced66ddee.tar.gz
go vet: composite literal uses unkeyed fields
This commit fixes all occurrences of the abovementioned lint-error in the codebase. Signed-off-by: Moritz Poldrack <git@moritz.sh> Acked-by: Robin Jarry <robin@jarry.cc>
Diffstat (limited to 'widgets')
-rw-r--r--widgets/account-wizard.go98
-rw-r--r--widgets/account.go6
-rw-r--r--widgets/aerc.go16
-rw-r--r--widgets/compose.go22
-rw-r--r--widgets/msgviewer.go18
5 files changed, 80 insertions, 80 deletions
diff --git a/widgets/account-wizard.go b/widgets/account-wizard.go
index 5c15a11f..1645d457 100644
--- a/widgets/account-wizard.go
+++ b/widgets/account-wizard.go
@@ -136,18 +136,18 @@ func NewAccountWizard(conf *config.AercConfig, aerc *Aerc) *AccountWizard {
})
basics := ui.NewGrid().Rows([]ui.GridSpec{
- {ui.SIZE_EXACT, ui.Const(8)}, // Introduction
- {ui.SIZE_EXACT, ui.Const(1)}, // Account name (label)
- {ui.SIZE_EXACT, ui.Const(1)}, // (input)
- {ui.SIZE_EXACT, ui.Const(1)}, // Padding
- {ui.SIZE_EXACT, ui.Const(1)}, // Full name (label)
- {ui.SIZE_EXACT, ui.Const(1)}, // (input)
- {ui.SIZE_EXACT, ui.Const(1)}, // Padding
- {ui.SIZE_EXACT, ui.Const(1)}, // Email address (label)
- {ui.SIZE_EXACT, ui.Const(1)}, // (input)
- {ui.SIZE_WEIGHT, ui.Const(1)},
+ {Strategy: ui.SIZE_EXACT, Size: ui.Const(8)}, // Introduction
+ {Strategy: ui.SIZE_EXACT, Size: ui.Const(1)}, // Account name (label)
+ {Strategy: ui.SIZE_EXACT, Size: ui.Const(1)}, // (input)
+ {Strategy: ui.SIZE_EXACT, Size: ui.Const(1)}, // Padding
+ {Strategy: ui.SIZE_EXACT, Size: ui.Const(1)}, // Full name (label)
+ {Strategy: ui.SIZE_EXACT, Size: ui.Const(1)}, // (input)
+ {Strategy: ui.SIZE_EXACT, Size: ui.Const(1)}, // Padding
+ {Strategy: ui.SIZE_EXACT, Size: ui.Const(1)}, // Email address (label)
+ {Strategy: ui.SIZE_EXACT, Size: ui.Const(1)}, // (input)
+ {Strategy: ui.SIZE_WEIGHT, Size: ui.Const(1)},
}).Columns([]ui.GridSpec{
- {ui.SIZE_WEIGHT, ui.Const(1)},
+ {Strategy: ui.SIZE_WEIGHT, Size: ui.Const(1)},
})
basics.AddChild(
ui.NewText("\nWelcome to aerc! Let's configure your account.\n\n"+
@@ -212,23 +212,23 @@ func NewAccountWizard(conf *config.AercConfig, aerc *Aerc) *AccountWizard {
})
incoming := ui.NewGrid().Rows([]ui.GridSpec{
- {ui.SIZE_EXACT, ui.Const(3)}, // Introduction
- {ui.SIZE_EXACT, ui.Const(1)}, // Username (label)
- {ui.SIZE_EXACT, ui.Const(1)}, // (input)
- {ui.SIZE_EXACT, ui.Const(1)}, // Padding
- {ui.SIZE_EXACT, ui.Const(1)}, // Password (label)
- {ui.SIZE_EXACT, ui.Const(1)}, // (input)
- {ui.SIZE_EXACT, ui.Const(1)}, // Padding
- {ui.SIZE_EXACT, ui.Const(1)}, // Server (label)
- {ui.SIZE_EXACT, ui.Const(1)}, // (input)
- {ui.SIZE_EXACT, ui.Const(1)}, // Padding
- {ui.SIZE_EXACT, ui.Const(1)}, // Connection mode (label)
- {ui.SIZE_EXACT, ui.Const(2)}, // (input)
- {ui.SIZE_EXACT, ui.Const(1)}, // Padding
- {ui.SIZE_EXACT, ui.Const(1)}, // Connection string
- {ui.SIZE_WEIGHT, ui.Const(1)},
+ {Strategy: ui.SIZE_EXACT, Size: ui.Const(3)}, // Introduction
+ {Strategy: ui.SIZE_EXACT, Size: ui.Const(1)}, // Username (label)
+ {Strategy: ui.SIZE_EXACT, Size: ui.Const(1)}, // (input)
+ {Strategy: ui.SIZE_EXACT, Size: ui.Const(1)}, // Padding
+ {Strategy: ui.SIZE_EXACT, Size: ui.Const(1)}, // Password (label)
+ {Strategy: ui.SIZE_EXACT, Size: ui.Const(1)}, // (input)
+ {Strategy: ui.SIZE_EXACT, Size: ui.Const(1)}, // Padding
+ {Strategy: ui.SIZE_EXACT, Size: ui.Const(1)}, // Server (label)
+ {Strategy: ui.SIZE_EXACT, Size: ui.Const(1)}, // (input)
+ {Strategy: ui.SIZE_EXACT, Size: ui.Const(1)}, // Padding
+ {Strategy: ui.SIZE_EXACT, Size: ui.Const(1)}, // Connection mode (label)
+ {Strategy: ui.SIZE_EXACT, Size: ui.Const(2)}, // (input)
+ {Strategy: ui.SIZE_EXACT, Size: ui.Const(1)}, // Padding
+ {Strategy: ui.SIZE_EXACT, Size: ui.Const(1)}, // Connection string
+ {Strategy: ui.SIZE_WEIGHT, Size: ui.Const(1)},
}).Columns([]ui.GridSpec{
- {ui.SIZE_WEIGHT, ui.Const(1)},
+ {Strategy: ui.SIZE_WEIGHT, Size: ui.Const(1)},
})
incoming.AddChild(ui.NewText("\nConfigure incoming mail (IMAP)",
conf.Ui.GetStyle(config.STYLE_DEFAULT)))
@@ -291,26 +291,26 @@ func NewAccountWizard(conf *config.AercConfig, aerc *Aerc) *AccountWizard {
})
outgoing := ui.NewGrid().Rows([]ui.GridSpec{
- {ui.SIZE_EXACT, ui.Const(3)}, // Introduction
- {ui.SIZE_EXACT, ui.Const(1)}, // Username (label)
- {ui.SIZE_EXACT, ui.Const(1)}, // (input)
- {ui.SIZE_EXACT, ui.Const(1)}, // Padding
- {ui.SIZE_EXACT, ui.Const(1)}, // Password (label)
- {ui.SIZE_EXACT, ui.Const(1)}, // (input)
- {ui.SIZE_EXACT, ui.Const(1)}, // Padding
- {ui.SIZE_EXACT, ui.Const(1)}, // Server (label)
- {ui.SIZE_EXACT, ui.Const(1)}, // (input)
- {ui.SIZE_EXACT, ui.Const(1)}, // Padding
- {ui.SIZE_EXACT, ui.Const(1)}, // Connection mode (label)
- {ui.SIZE_EXACT, ui.Const(2)}, // (input)
- {ui.SIZE_EXACT, ui.Const(1)}, // Padding
- {ui.SIZE_EXACT, ui.Const(1)}, // Connection string
- {ui.SIZE_EXACT, ui.Const(1)}, // Padding
- {ui.SIZE_EXACT, ui.Const(1)}, // Copy to sent (label)
- {ui.SIZE_EXACT, ui.Const(2)}, // (input)
- {ui.SIZE_WEIGHT, ui.Const(1)},
+ {Strategy: ui.SIZE_EXACT, Size: ui.Const(3)}, // Introduction
+ {Strategy: ui.SIZE_EXACT, Size: ui.Const(1)}, // Username (label)
+ {Strategy: ui.SIZE_EXACT, Size: ui.Const(1)}, // (input)
+ {Strategy: ui.SIZE_EXACT, Size: ui.Const(1)}, // Padding
+ {Strategy: ui.SIZE_EXACT, Size: ui.Const(1)}, // Password (label)
+ {Strategy: ui.SIZE_EXACT, Size: ui.Const(1)}, // (input)
+ {Strategy: ui.SIZE_EXACT, Size: ui.Const(1)}, // Padding
+ {Strategy: ui.SIZE_EXACT, Size: ui.Const(1)}, // Server (label)
+ {Strategy: ui.SIZE_EXACT, Size: ui.Const(1)}, // (input)
+ {Strategy: ui.SIZE_EXACT, Size: ui.Const(1)}, // Padding
+ {Strategy: ui.SIZE_EXACT, Size: ui.Const(1)}, // Connection mode (label)
+ {Strategy: ui.SIZE_EXACT, Size: ui.Const(2)}, // (input)
+ {Strategy: ui.SIZE_EXACT, Size: ui.Const(1)}, // Padding
+ {Strategy: ui.SIZE_EXACT, Size: ui.Const(1)}, // Connection string
+ {Strategy: ui.SIZE_EXACT, Size: ui.Const(1)}, // Padding
+ {Strategy: ui.SIZE_EXACT, Size: ui.Const(1)}, // Copy to sent (label)
+ {Strategy: ui.SIZE_EXACT, Size: ui.Const(2)}, // (input)
+ {Strategy: ui.SIZE_WEIGHT, Size: ui.Const(1)},
}).Columns([]ui.GridSpec{
- {ui.SIZE_WEIGHT, ui.Const(1)},
+ {Strategy: ui.SIZE_WEIGHT, Size: ui.Const(1)},
})
outgoing.AddChild(ui.NewText("\nConfigure outgoing mail (SMTP)",
conf.Ui.GetStyle(config.STYLE_DEFAULT)))
@@ -387,10 +387,10 @@ func NewAccountWizard(conf *config.AercConfig, aerc *Aerc) *AccountWizard {
})
complete := ui.NewGrid().Rows([]ui.GridSpec{
- {ui.SIZE_EXACT, ui.Const(7)}, // Introduction
- {ui.SIZE_WEIGHT, ui.Const(1)}, // Previous / Finish / Finish & open tutorial
+ {Strategy: ui.SIZE_EXACT, Size: ui.Const(7)}, // Introduction
+ {Strategy: ui.SIZE_WEIGHT, Size: ui.Const(1)}, // Previous / Finish / Finish & open tutorial
}).Columns([]ui.GridSpec{
- {ui.SIZE_WEIGHT, ui.Const(1)},
+ {Strategy: ui.SIZE_WEIGHT, Size: ui.Const(1)},
})
complete.AddChild(ui.NewText(
"\nConfiguration complete!\n\n"+
diff --git a/widgets/account.go b/widgets/account.go
index e8bda3f7..87a8cef5 100644
--- a/widgets/account.go
+++ b/widgets/account.go
@@ -58,12 +58,12 @@ func NewAccountView(aerc *Aerc, conf *config.AercConfig, acct *config.AccountCon
}
view.grid = ui.NewGrid().Rows([]ui.GridSpec{
- {ui.SIZE_WEIGHT, ui.Const(1)},
+ {Strategy: ui.SIZE_WEIGHT, Size: ui.Const(1)},
}).Columns([]ui.GridSpec{
- {ui.SIZE_EXACT, func() int {
+ {Strategy: ui.SIZE_EXACT, Size: func() int {
return view.UiConfig().SidebarWidth
}},
- {ui.SIZE_WEIGHT, ui.Const(1)},
+ {Strategy: ui.SIZE_WEIGHT, Size: ui.Const(1)},
})
worker, err := worker.NewWorker(acct.Source, logger)
diff --git a/widgets/aerc.go b/widgets/aerc.go
index 5dda8882..64b872c5 100644
--- a/widgets/aerc.go
+++ b/widgets/aerc.go
@@ -57,11 +57,11 @@ func NewAerc(conf *config.AercConfig, logger *log.Logger,
statusbar.Push(statusline)
grid := ui.NewGrid().Rows([]ui.GridSpec{
- {ui.SIZE_EXACT, ui.Const(1)},
- {ui.SIZE_WEIGHT, ui.Const(1)},
- {ui.SIZE_EXACT, ui.Const(1)},
+ {Strategy: ui.SIZE_EXACT, Size: ui.Const(1)},
+ {Strategy: ui.SIZE_WEIGHT, Size: ui.Const(1)},
+ {Strategy: ui.SIZE_EXACT, Size: ui.Const(1)},
}).Columns([]ui.GridSpec{
- {ui.SIZE_WEIGHT, ui.Const(1)},
+ {Strategy: ui.SIZE_WEIGHT, Size: ui.Const(1)},
})
grid.AddChild(tabs.TabStrip)
grid.AddChild(tabs.TabContent).At(1, 0)
@@ -667,11 +667,11 @@ func errorScreen(s string, conf config.UIConfig) ui.Drawable {
errstyle := conf.GetStyle(config.STYLE_ERROR)
text := ui.NewText(s, errstyle).Strategy(ui.TEXT_CENTER)
grid := ui.NewGrid().Rows([]ui.GridSpec{
- {ui.SIZE_WEIGHT, ui.Const(1)},
- {ui.SIZE_EXACT, ui.Const(1)},
- {ui.SIZE_WEIGHT, ui.Const(1)},
+ {Strategy: ui.SIZE_WEIGHT, Size: ui.Const(1)},
+ {Strategy: ui.SIZE_EXACT, Size: ui.Const(1)},
+ {Strategy: ui.SIZE_WEIGHT, Size: ui.Const(1)},
}).Columns([]ui.GridSpec{
- {ui.SIZE_WEIGHT, ui.Const(1)},
+ {Strategy: ui.SIZE_WEIGHT, Size: ui.Const(1)},
})
grid.AddChild(ui.NewFill(' ', tcell.StyleDefault)).At(0, 0)
grid.AddChild(text).At(1, 0)
diff --git a/widgets/compose.go b/widgets/compose.go
index 977c4c43..13002295 100644
--- a/widgets/compose.go
+++ b/widgets/compose.go
@@ -783,14 +783,14 @@ func (c *Composer) updateGrid() {
if c.grid == nil {
c.grid = ui.NewGrid().Columns([]ui.GridSpec{
- {ui.SIZE_WEIGHT, ui.Const(1)},
+ {Strategy: ui.SIZE_WEIGHT, Size: ui.Const(1)},
})
}
c.grid.Rows([]ui.GridSpec{
- {ui.SIZE_EXACT, ui.Const(height)},
- {ui.SIZE_EXACT, ui.Const(1)},
- {ui.SIZE_WEIGHT, ui.Const(1)},
+ {Strategy: ui.SIZE_EXACT, Size: ui.Const(height)},
+ {Strategy: ui.SIZE_EXACT, Size: ui.Const(1)},
+ {Strategy: ui.SIZE_WEIGHT, Size: ui.Const(1)},
})
if c.heditors != nil {
@@ -979,21 +979,21 @@ func newReviewMessage(composer *Composer, err error) *reviewMessage {
}
spec := []ui.GridSpec{
- {ui.SIZE_EXACT, ui.Const(1)},
+ {Strategy: ui.SIZE_EXACT, Size: ui.Const(1)},
}
for i := 0; i < len(actions)-1; i++ {
- spec = append(spec, ui.GridSpec{ui.SIZE_EXACT, ui.Const(1)})
+ spec = append(spec, ui.GridSpec{Strategy: ui.SIZE_EXACT, Size: ui.Const(1)})
}
- spec = append(spec, ui.GridSpec{ui.SIZE_EXACT, ui.Const(2)})
- spec = append(spec, ui.GridSpec{ui.SIZE_EXACT, ui.Const(1)})
+ spec = append(spec, ui.GridSpec{Strategy: ui.SIZE_EXACT, Size: ui.Const(2)})
+ spec = append(spec, ui.GridSpec{Strategy: ui.SIZE_EXACT, Size: ui.Const(1)})
for i := 0; i < len(composer.attachments)-1; i++ {
- spec = append(spec, ui.GridSpec{ui.SIZE_EXACT, ui.Const(1)})
+ spec = append(spec, ui.GridSpec{Strategy: ui.SIZE_EXACT, Size: ui.Const(1)})
}
// make the last element fill remaining space
- spec = append(spec, ui.GridSpec{ui.SIZE_WEIGHT, ui.Const(1)})
+ spec = append(spec, ui.GridSpec{Strategy: ui.SIZE_WEIGHT, Size: ui.Const(1)})
grid := ui.NewGrid().Rows(spec).Columns([]ui.GridSpec{
- {ui.SIZE_WEIGHT, ui.Const(1)},
+ {Strategy: ui.SIZE_WEIGHT, Size: ui.Const(1)},
})
uiConfig := composer.config.Ui
diff --git a/widgets/msgviewer.go b/widgets/msgviewer.go
index 9771a905..9b40dede 100644
--- a/widgets/msgviewer.go
+++ b/widgets/msgviewer.go
@@ -71,7 +71,7 @@ func NewMessageViewer(acct *AccountView,
)
rows := []ui.GridSpec{
- {ui.SIZE_EXACT, ui.Const(headerHeight)},
+ {Strategy: ui.SIZE_EXACT, Size: ui.Const(headerHeight)},
}
if msg.PGPDetails() != nil {
@@ -79,16 +79,16 @@ func NewMessageViewer(acct *AccountView,
if msg.PGPDetails().IsSigned && msg.PGPDetails().IsEncrypted {
height = 2
}
- rows = append(rows, ui.GridSpec{ui.SIZE_EXACT, ui.Const(height)})
+ rows = append(rows, ui.GridSpec{Strategy: ui.SIZE_EXACT, Size: ui.Const(height)})
}
rows = append(rows, []ui.GridSpec{
- {ui.SIZE_EXACT, ui.Const(1)},
- {ui.SIZE_WEIGHT, ui.Const(1)},
+ {Strategy: ui.SIZE_EXACT, Size: ui.Const(1)},
+ {Strategy: ui.SIZE_WEIGHT, Size: ui.Const(1)},
}...)
grid := ui.NewGrid().Rows(rows).Columns([]ui.GridSpec{
- {ui.SIZE_WEIGHT, ui.Const(1)},
+ {Strategy: ui.SIZE_WEIGHT, Size: ui.Const(1)},
})
switcher := &PartSwitcher{}
@@ -539,11 +539,11 @@ func NewPartViewer(acct *AccountView, conf *config.AercConfig,
}
grid := ui.NewGrid().Rows([]ui.GridSpec{
- {ui.SIZE_EXACT, ui.Const(3)}, // Message
- {ui.SIZE_EXACT, ui.Const(1)}, // Selector
- {ui.SIZE_WEIGHT, ui.Const(1)},
+ {Strategy: ui.SIZE_EXACT, Size: ui.Const(3)}, // Message
+ {Strategy: ui.SIZE_EXACT, Size: ui.Const(1)}, // Selector
+ {Strategy: ui.SIZE_WEIGHT, Size: ui.Const(1)},
}).Columns([]ui.GridSpec{
- {ui.SIZE_WEIGHT, ui.Const(1)},
+ {Strategy: ui.SIZE_WEIGHT, Size: ui.Const(1)},
})
selector := NewSelector([]string{"Save message", "Pipe to command"},