aboutsummaryrefslogtreecommitdiffstats
path: root/config/statusline.go
Commit message (Collapse)AuthorAgeFilesLines
* config: change default appearanceRobin Jarry2024-02-141-1/+1
| | | | | | | | | | | | | | | | | | | The default styleset and ui settings are quite dull and don't make use of the "newer" features that have been added to aerc in the past two years. Change the default styleset to something more colorful that renders correctly on both dark and light backgrounds. Change the default ui settings to get something more appealing to new users. Save the previous default color theme to a new `monochrome` styleset. Changelog-changed: The default `[ui]` settings and the `default` styleset have changed extensively. A no-color theme can be restored with the `monochrome` styleset. Cc: Marc Coquand <marc@mccd.space> Signed-off-by: Robin Jarry <robin@jarry.cc> Tested-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
* log: move package to libRobin Jarry2024-02-141-1/+1
| | | | | | | This has nothing to do at the root of the source tree. Signed-off-by: Robin Jarry <robin@jarry.cc> Acked-by: Bence Ferdinandy <bence@ferdinandy.com>
* config: remove deprecated settingsMoritz Poldrack2024-01-081-96/+0
| | | | | | | | | | Several settings have been deprecated a few versions ago and announced their removal in 0.17. Remove these deprecated sections and their uses. Signed-off-by: Moritz Poldrack <git@moritz.sh> Acked-by: Robin Jarry <robin@jarry.cc>
* statusline: fix typo in deprecation warningVlad-Stefan Harbuz2023-05-211-2/+2
| | | | | | | | This was a bad copy paste from config/ui.go. Fixes: d2e74cdb91e1 ("statusline: add column based render format") Signed-off-by: Vlad-Stefan Harbuz <vlad@vladh.net> Acked-by: Robin Jarry <robin@jarry.cc>
* config: use reflection to map ini keys to struct fieldsRobin Jarry2023-03-021-53/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The default ini.Section.MapTo() function only handles basic types. Implement a more complete mapping solution that allows: * parsing templates, regexps, email addresses * defining a custom parsing method via the `parse:"MethodName"` tag * defining default values via the `default:"value"` tag * parsing rune values with the `type:"rune"` tag The field name must be specified in the `ini:"field-name"` tag as it was before. It is no longer optional. The `delim:"<separator>"` tag remains but can only be used to parse string arrays. It is now possible to override default values with "zero" values. For example: [ui] dirlist-delay = 0 Will override the default "200ms" value. Also: [statusline] status-columns = Will override the default "left<*,center>=,right>*" value. Signed-off-by: Robin Jarry <robin@jarry.cc> Tested-by: Tim Culverhouse <tim@timculverhouse.com>
* statusline: add column based render formatRobin Jarry2023-02-201-5/+133
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the spirit of commit 535300cfdbfc ("config: add columns based index format"), reuse the column definitions and table widget. Add automatic translation of render-format to column definitions. Allow empty columns to be compatible with the %m (mute) flag. Rename the State object to AccountState to be more precise. Reuse that object in state.TempateData to expose account state info. Move actual status line rendering in StatusLine.Draw(). Add new template fields for status specific data: {{.ConnectionInfo}} Connection state. {{.ContentInfo}} General status information (e.g. filter, search) {{.StatusInfo}} Combination of {{.ConnectionInfo}} and {{.StatusInfo}} {{.TrayInfo}} General on/off information (e.g. passthrough, threading, sorting) {{.PendingKeys}} Currently pressed key sequence that does not match any key binding and/or is incomplete. Display a warning on startup if render-format has been converted to status-columns. Signed-off-by: Robin Jarry <robin@jarry.cc> Acked-by: Tim Culverhouse <tim@timculverhouse.com>
* config: make various sections accessible via global varsRobin Jarry2022-12-141-5/+7
| | | | | | | | | | | | | | | | | | | | There is only one instance of AercConfig which is associated to the Aerc widget. Everywhere we need to access configuration options, we need somehow to get a reference either to the Aerc widget or to a pointer to the AercConfig instance. This makes the code cluttered. Remove the AercConfig structure and every place where it is referenced. Instead, declare global variables for every configuration section and access them directly from the `config` module. Since bindings and ui sections can be "contextual" (i.e. per account, per folder or per subject), leave most local references intact. Replacing them with config.{Ui,Binds}.For{Account,Folder,Subject} would make this patch even more unreadable. This is something that may be addressed in the future. Signed-off-by: Robin Jarry <robin@jarry.cc> Acked-by: Tim Culverhouse <tim@timculverhouse.com>
* logging: rename package to logRobin Jarry2022-12-021-2/+2
| | | | | | | | | | Use the same name than the builtin "log" package. That way, we do not risk logging in the wrong place. Suggested-by: Tim Culverhouse <tim@timculverhouse.com> Signed-off-by: Robin Jarry <robin@jarry.cc> Tested-by: Bence Ferdinandy <bence@ferdinandy.com> Acked-by: Tim Culverhouse <tim@timculverhouse.com>
* config: move [statusline] in separate fileRobin Jarry2022-11-161-0/+33
The config.go file is getting too big. Move the aerc.conf [statusline] section parsing logic into a dedicated statusline.go file. No functional change. Please ignore the casual "realignment" of fields in the default config initialization. Thanks gofmt. Signed-off-by: Robin Jarry <robin@jarry.cc> Acked-by: Moritz Poldrack <moritz@poldrack.dev>