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 25579d8807
terminal/cells: remove ansi module 3 years ago
Manos Pitsidianakis 1c25ae12eb
Use default_cell in CellBuffer resize(), clear() 3 years ago
Manos Pitsidianakis ccc083cf88
Rewrite Cellbuffer Debug impl 3 years ago
Manos Pitsidianakis 7db32ff1b3
terminal/cells: return success flag in CellBuffer::resize() 4 years ago
Manos Pitsidianakis 6dd3b0bb4f
Fix theme_default not being respected 4 years ago
Manos Pitsidianakis 714ccb5e16
Move Color to src/terminal/color.rs 4 years ago
Manos Pitsidianakis b659749880
listing: scroll account sidebar menu
Closes #85 Accounts sidebar doesn't scroll
4 years ago
Manos Pitsidianakis 188e020bd1
Add opt-in mouse support
Sidebar width can be resized with mouse hold and drag.
4 years ago
Manos Pitsidianakis 5db749c258
terminal/cells.rs: fix resize to grow actually making the grid smaller 4 years ago
Manos Pitsidianakis fb523c140a
terminal/cells: resize growable grid when exactly at bounds 4 years ago
Manos Pitsidianakis a7e177586a
Fix clippy lints 4 years ago
Manos Pitsidianakis b946b61cf1
terminal/cells.rs: remove unused variables 4 years ago
Manos Pitsidianakis fe655e679c
Fix rustfmt suggestions 4 years ago
Manos Pitsidianakis 55948dd7c2
Use BTreeSet instead of HashSet in copy_area()
I kind of forgot about BTreeSets, and kept a separate HashSet and sorted
index of the set's keys.
4 years ago
Manos Pitsidianakis c07185a3aa
regexp: add priority field to regular expressions 4 years ago
Manos Pitsidianakis 465c78e903
Add Cell::keep_attrs() method 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 ef0f269fbf
terminal: add FormatTag, text format tags
FormatTag describes a set of attributes, colors that exist in a
tag_table field of CellBuffer. The field of tag_associations contains
the hash of a tag and the {start,end} index of the cells that have this
attribute. A tag can thus be used many times.

An example of use is

    let t = self.pager.insert_tag(FormatTag {
        attrs: Attr::ITALICS,
        ..Default::default()
    });
    debug!("FormatTag hash = {}", t);
    let (width, height) = self.pager.size();
    for i in 0..height {
      if self.pager.content[(0, i)].ch() == '>' {
        self.pager.set_tag(t, (0, i), (width.saturating_sub(1), i));
      }
    }

This will set reply lines in text as italics.

This feature interface is not used anywhere yet.
4 years ago
Manos Pitsidianakis 049175e743
pager: fix filter invocation and ansi parsing 4 years ago
Manos Pitsidianakis 12feca9c97
terminal/ansi: add attribute support
Add attribute escape sequence support in terminal::ansi, which handles
converting strings with ansi escape sequences into meli's internal
terminal structures in order to incorporate them into the UI.
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 a8c1016f37
Add various logic checks 4 years ago
Manos Pitsidianakis 63af2a688a
Detect breaks on write_string_to_grid 4 years ago
Manos Pitsidianakis ac71d627f1
Implement search for CellBuffer 4 years ago
Manos Pitsidianakis c88d1cae51
Fix create_box boundary fg color 4 years ago
Manos Pitsidianakis eb501b6d50
ui: add ThemeAttribute argument to clear_area()
clear_area() sets the cleared cell attributes according to the new
argument.
4 years ago
Manos Pitsidianakis d6e3c51b07
ui: move box drawing to src/terminal
No logical reason for it not to be in the terminal module anymore (the
set_and_join* functions predate the terminal module which is why they
weren't there to begin with).
4 years ago
Manos Pitsidianakis 05b91f1c02
Remove text_processing
Unwrap text_processing into melib

In preparation for uploading meli as a separate crate on crates.io.
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