Implement sidebar-width config option
This commit is contained in:
parent
f406bf5a3b
commit
a729179f9f
3 changed files with 12 additions and 10 deletions
|
@ -11,14 +11,14 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
type UIConfig struct {
|
type UIConfig struct {
|
||||||
IndexFormat string
|
IndexFormat string `ini:"index-format"`
|
||||||
TimestampFormat string
|
TimestampFormat string `ini:"timestamp-format"`
|
||||||
ShowHeaders []string `delim:","`
|
ShowHeaders []string `delim:","`
|
||||||
LoadingFrames []string `delim:","`
|
LoadingFrames []string `delim:","`
|
||||||
RenderAccountTabs string
|
RenderAccountTabs string `ini:"render-account-tabs"`
|
||||||
SidebarWidth int
|
SidebarWidth int `ini:"sidebar-width"`
|
||||||
PreviewHeight int
|
PreviewHeight int `ini:"preview-height"`
|
||||||
EmptyMessage string
|
EmptyMessage string `ini:"empty-message"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type AccountConfig struct {
|
type AccountConfig struct {
|
||||||
|
@ -114,7 +114,10 @@ func LoadConfig(root *string) (*AercConfig, error) {
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
if ui, err := file.GetSection("ui"); err == nil {
|
if ui, err := file.GetSection("ui"); err == nil {
|
||||||
ui.MapTo(config.Ui)
|
if err := ui.MapTo(&config.Ui); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
fmt.Printf("%v\n", config.Ui)
|
||||||
}
|
}
|
||||||
if lbinds, err := file.GetSection("lbinds"); err == nil {
|
if lbinds, err := file.GetSection("lbinds"); err == nil {
|
||||||
for key, value := range lbinds.KeysHash() {
|
for key, value := range lbinds.KeysHash() {
|
||||||
|
|
|
@ -41,7 +41,7 @@ func NewAccountView(conf *config.AercConfig, acct *config.AccountConfig,
|
||||||
{ui.SIZE_WEIGHT, 1},
|
{ui.SIZE_WEIGHT, 1},
|
||||||
{ui.SIZE_EXACT, 1},
|
{ui.SIZE_EXACT, 1},
|
||||||
}).Columns([]ui.GridSpec{
|
}).Columns([]ui.GridSpec{
|
||||||
{ui.SIZE_EXACT, 20},
|
{ui.SIZE_EXACT, conf.Ui.SidebarWidth},
|
||||||
{ui.SIZE_WEIGHT, 1},
|
{ui.SIZE_WEIGHT, 1},
|
||||||
})
|
})
|
||||||
grid.AddChild(statusbar).At(1, 1)
|
grid.AddChild(statusbar).At(1, 1)
|
||||||
|
|
|
@ -26,11 +26,10 @@ func NewAerc(conf *config.AercConfig, logger *log.Logger,
|
||||||
{libui.SIZE_EXACT, 1},
|
{libui.SIZE_EXACT, 1},
|
||||||
{libui.SIZE_WEIGHT, 1},
|
{libui.SIZE_WEIGHT, 1},
|
||||||
}).Columns([]libui.GridSpec{
|
}).Columns([]libui.GridSpec{
|
||||||
{libui.SIZE_EXACT, 20},
|
{libui.SIZE_EXACT, conf.Ui.SidebarWidth},
|
||||||
{libui.SIZE_WEIGHT, 1},
|
{libui.SIZE_WEIGHT, 1},
|
||||||
})
|
})
|
||||||
|
|
||||||
// TODO: Grab sidebar size from config and via :set command
|
|
||||||
mainGrid.AddChild(libui.NewText("aerc").
|
mainGrid.AddChild(libui.NewText("aerc").
|
||||||
Strategy(libui.TEXT_CENTER).
|
Strategy(libui.TEXT_CENTER).
|
||||||
Color(tcell.ColorBlack, tcell.ColorWhite))
|
Color(tcell.ColorBlack, tcell.ColorWhite))
|
||||||
|
|
Loading…
Reference in a new issue