Commit Graph

31 Commits (9cb66ef818f6598eb779f931e201a8d38e86a484)

Author SHA1 Message Date
Manos Pitsidianakis 9cb66ef818 Fix all clippy warnings in `meli` crate 2 years ago
Manos Pitsidianakis 2eb22a290a
Stop hardcoding certain component colors
`Color::Byte` references were before themes were introduced in the code
base. Their presence is a bug and they should all be replaced by theme
values.

Closes #124

Stop hardcoding certain component colors #124
https://git.meli.delivery/meli/meli/issues/124
2 years ago
Manos Pitsidianakis 5823178cc2
themes.rs: add test that looks in source code for invalid theme key references 2 years ago
Manos Pitsidianakis b411daddaa
listing/conversations: remove entry padding box character
Remove padding each entry with '░' box character.
3 years ago
Manos Pitsidianakis 7e1e57a2df
conf/themes: add mail.view.headers_names and mail.view.headers_area
Allow separate customization of header names and the rest of the header
area.
4 years ago
Manos Pitsidianakis 4914f29e20
themes: make conversations defaults grey 4 years ago
Manos Pitsidianakis de018294e4
conf/themes: make notifications bg default color instead of red 4 years ago
Andrew Jeffery daee4e46de
Allow configuration of the sidebar divider
This adds the config option listing.sidebar_divider to set the character
used to show the divider (defaults to ' ') along with the corresponding
theme in mail.sidebar_divider which defaults to the default theme.
4 years ago
Manos Pitsidianakis b94342c52b
themes/regexp: fix unwrap check on regexp match byte offsets 4 years ago
Manos Pitsidianakis bb4754e38a
themes/shortcuts: preserve order of keys 4 years ago
Manos Pitsidianakis 52bcecfd4a
conf.rs: reject unknown configuration options
Closes #11
4 years ago
Manos Pitsidianakis f9efaea0ec
ConversationsListing: fix invalid update_line colors 4 years ago
Manos Pitsidianakis 1bd89b3c96
themes: add mail.sidebar_account_name key 4 years ago
Manos Pitsidianakis a7e177586a
Fix clippy lints 4 years ago
Manos Pitsidianakis c07185a3aa
regexp: add priority field to regular expressions 4 years ago
Manos Pitsidianakis 3e31c46a74
Add "regexp" feature, format text with regexps
`regexp` feature uses the pcre2 library to enable the user to define
regular expressions for matching text and applying text formatting to
the matches. An example from the theme configuration I used to test
this:

  [terminal.themes.win95.text_format_regexps]
  "listing.subject" = { "\\[[^\\]]*\\]" = { attrs = "Bold" } }
  "listing.from" = { "\\<[^\\>]*\\>(?:(?:\\s*$)|(?=,))" = { attrs = "Italics" } }

  [terminal.themes.win95.text_format_regexps."pager.envelope.body"]
  "^>.*$" = { attrs = "Italics" }
  "\\d+\\s?(?:(?:[KkMmTtGg]?[Bb])|(?:[KkMmTtGg][Bb]?)(?=\\s))" = { attrs = "Bold | Underline" }
4 years ago
Manos Pitsidianakis de03b106f3
themes: Add support for Color/Attribute aliases
Add aliases to avoid repetition of raw values when defining new themes.
Aliases are strings starting with "$" and must be defined in the
`color_aliases` and `attr_aliases` fields of a theme.
4 years ago
Manos Pitsidianakis eca8a30c3f
themes: Add Theme struct
Wrap HashMap<Cow<'static, str>, ThemeAttributeInner> into a struct, in
order to add more fields in the future.
4 years ago
Manos Pitsidianakis fa96a4e905
themes: add support for optional field theme value links
Theme attribute values can refer to another theme key instead of
defining a value. Add support for optionally defining the theme key's
field by appending a ".fg" or ".bg" suffix to the link's key.
4 years ago
Manos Pitsidianakis 9c0ee76ff4
themes: Rename Theme struct to Themes 4 years ago
Manos Pitsidianakis bee1baedb2
themes: add indentation level color keys
Add theme keys for the indentation level colors in ThreadView
4 years ago
Manos Pitsidianakis d580b25415
themes: overwrite only explicit key attributes
If user config file overwrites a single attribute and not the others,
for example only bg:

  "mail.listing.tag_default" = { bg = "Blue" }

The other attributes, in this case fg and attrs revert to the default
values of ThemeAttributeInner and not the default value for the key
"mail.listing.tag_default". As a result the above expands to:

  "mail.listing.tag_default" = { fg = Color::Default, bg = "Blue", attrs
  = Attr::Default }

This commit keeps the key value defaults, so the above should expand to:

  "mail.listing.tag_default" = { fg = default_theme["mail.listing.tag_default"].fg, bg = "Blue", attrs
  = default_theme["mail.listing.tag_default"].attrs }
4 years ago
Manos Pitsidianakis d8135674df
themes: add {even,odd}_unseen, {even,odd}_selected, {even,odd}_highlighted
Suggested in #21
4 years ago
Manos Pitsidianakis e633434b93
themes: Fix invalid attribute links panic in is_cyclic
Attribute links are not checked for validity in theme validation, and an
invalid link would cause a panic in is_cyclic.

This commit improves the theme validation errors by printing if the
error lies in a theme key or a link.
4 years ago
Manos Pitsidianakis 4930d1b46c
Add Italics, Blink, Dim and Hidden text attributes
Text attributes have been rewritten as bit flags, so for example instead of
"BoldUnderline" you'd have to define "Bold | Underline" in your theme
settings.

Requested in #21
4 years ago
Manos Pitsidianakis 840005022c
themes: add default tag theme attribute
The theme attribute key is "mail.listing.tag_default"
4 years ago
Manos Pitsidianakis 1245eae0be
Add Knuth–Morris–Pratt to pager 4 years ago
Manos Pitsidianakis c22a141b14
ui/themes: expand theme coverage to status panel and contacts 4 years ago
Manos Pitsidianakis 42747ef590
ui/themes: make theme_default the default for other keys 4 years ago
Manos Pitsidianakis d6f04c9ed3
Fix IntoIterator warning 4 years ago
Manos Pitsidianakis 8b6ea8de9a
Remove ui crate
Merge ui crate with root crate.

In preparation for uploading `meli` as a separate crate on crates.io.

Workspace crates will need to be published as well and having a separate
`ui` crate and binary perhaps doesn't make sense anymore.
4 years ago