Commit Graph

150 Commits (a365a846b8e8bca8f053e8f7152604e0103a7181)

Author SHA1 Message Date
Manos Pitsidianakis a365a846b8
Replace StackVec with smallvec::SmallVec
SmallVec has a less buggy and better implementation.
5 years ago
Manos Pitsidianakis b6403f486b
ui: Remove RefreshMailbox event
Leftover from older versions, it wasn't used  anywhere
5 years ago
Manos Pitsidianakis c0ac643f05
melib: add datetime module
Datetime module adds POSIX time functions interface
5 years ago
Manos Pitsidianakis 8f63572584
Small refactors to avoid implicit unwrap() panics 5 years ago
Manos Pitsidianakis ab3e01359a
ui/Component: change set_dirty() to set_dirty(value)
Next commit will need to set a child component as not dirty so we need
set_dirty(value) instead of set_dirty() that always sets is to true.
5 years ago
Manos Pitsidianakis 328b17a995
ui/CompactListing: use Segment Trees to calculate max page column width
Given a range of entries that occupy a page (eg [0, 50] for a page of 50
rows high) get the max entry width for this column by using maximum
range queries with segment trees.
5 years ago
Manos Pitsidianakis 7432be5aaa
ui/listings: truncate subject at 150 grapheme width
Large subjects would cause large CellBuffer allocations.
5 years ago
Manos Pitsidianakis b401b64f35
ui/CellBuffer: change row_iter() bounds to Range
Writing a range x..y is more ergonomic than (x, y+ 1)
5 years ago
Manos Pitsidianakis 0eaf17871a
melib: add set_tags command in BackendOp 5 years ago
Manos Pitsidianakis f632bc4c08
ui: update rows on TagAdd/TagRemove
Except for threadlisting
5 years ago
Manos Pitsidianakis c6f1fa9be0
ui: Add TagAction
Add/Remove
5 years ago
Manos Pitsidianakis e5da10093d
ui/listing: use MailListingTrait instead of ListingTrait 5 years ago
Manos Pitsidianakis 8e27b86453
Add MailListingTrait
Inheriting ListingTrait
5 years ago
Manos Pitsidianakis 6cf73b4238
Remove Option<EnvelopeHash> from ListingTrait
It was never used.
5 years ago
Manos Pitsidianakis d376f83f48
ui/conversations: fix padding left unpainted 5 years ago
Manos Pitsidianakis c431fb6dff
ui: use BoundsIterator in clear_area 5 years ago
Manos Pitsidianakis 16ccff0f44
ui: add RowIterator and BoundsIterator for CellBuffer
Use `RowIterator` to iterate the cells of a row without the need to do
any bounds checking; the iterator will simply return `None` when it
reaches the end of the row.  `RowIterator` can be created via the
`CellBuffer::row_iter` method and can be returned by `BoundsIterator`
which iterates each row.
5 years ago
Manos Pitsidianakis 3ae43817a1
ui: user-configured colors for tags in mail listings 5 years ago
Manos Pitsidianakis bca33370cc
Add tag settings in UI config module 5 years ago
Manos Pitsidianakis 19a268b8a7
ui: add tags in compact, conversations 5 years ago
Manos Pitsidianakis d31c629ac4
ui: add tags in plain listing 5 years ago
Manos Pitsidianakis c04513ac94
ui: add shortcut! macro to compare shortcuts values
This is used in process_event() functions of UI Components. When a key
has been input we have to compare it with the configured shortcuts from
a hashmap.

Add shortcut! macro that checks shortcut hashmaps for the given name and
doesn't panic if it's missing.
5 years ago
Manos Pitsidianakis 424b244bb7
fixup some TODO and FIXMEs 5 years ago
Manos Pitsidianakis f1588f6002
ui: shortcuts refactoring 5 years ago
Manos Pitsidianakis 8798d84e43
ui: update cached rows on row update in CompactListing 5 years ago
Manos Pitsidianakis 995e70e009
ui: change line_break meaning in write_string_to_grid
Change line_break parameter from bool flag (whether to break in the end
of a line or not) to an Option<usize>, where the value is the x_offset
of the left side of the area. Thus if line_break == Some(_) when a line
ends its value is set as x to continue in the next line properly.
5 years ago
Manos Pitsidianakis f8a1a6caa5
melib: replace find_thread_group with find_root_hash
thread_group property of ThreadNode doesn't yet reflect the actual root
ThreadNode (the root of the thread, that is). So find the root manually
instead.
5 years ago
Manos Pitsidianakis bd4cf860fa
ui: persist row highlighting in CompactListing 5 years ago
Manos Pitsidianakis 0d03116e8a
ui: correct row highlighting in CompactListing 5 years ago
Manos Pitsidianakis aeb9d046a2
ui/ThreadListing: fix uninitialized array entry crash
If ThreadListing is uninitialized, self.locations is empty and
coordinates() would panic.
5 years ago
Manos Pitsidianakis 56cda63c83
Fix some warnings 5 years ago
Manos Pitsidianakis 94152f7336
ui: add multiplier shortcuts to cursor movements
Prepend a cursor movement (Up/Down/PageUp/PageDown) with a multiplier
(e.g 23+Down, that is '2' then '3' then 'Down') to increase the
movement's length.
5 years ago
Manos Pitsidianakis 97e20b22a8
ui: update PlainListing
Remake PlainListing after CompactListing to add columns, filtering,
selection.
5 years ago
Manos Pitsidianakis 098982015b
ui/conversations: show all participating addresses in entry
Show all unique From: values of addresses in thread entries in
Conversations
5 years ago
Manos Pitsidianakis f718510eeb
ui/listings: split events according to length
Some events are invalid when there are no messages shown in the listing.
Instead of checking for self.length > 0 in each of these events, put
them together in an if block.
5 years ago
Manos Pitsidianakis 498f8e8e21
ui/listings: Show errors when filtering
Errors were not shown properly because the data_columns grids were being
overwritten by redraw_list(). Call redraw_list() only if filtering was
succesful.
5 years ago
Manos Pitsidianakis 78eecbb104
melib: Hide Envelope behind RwLock
Envelope can now only be accessed from within a RwLock. Two new structs
are introduced: EnvelopeRef and EnvelopeRefMut. These hold a reference
to an Envelope and the mutex guard that keeps them alive.

This change allows sharing of the envelopes hash map amongst threads.
5 years ago
Manos Pitsidianakis e9d17f6897
add cache struct in Account 5 years ago
Manos Pitsidianakis d1184d4ea5
ui/search: add sorting in search 5 years ago
Manos Pitsidianakis 1b0b699527
ui/listing: mail filter refactoring
- show result count and 'Press ESC to go back' message
- search successfully even if currently viewing search results
5 years ago
Manos Pitsidianakis 3af6f338ce
add sqlite3 feature WIP 5 years ago
Manos Pitsidianakis b075501ef7
ui/listing: tidy mail listing shortcuts
- move set_seen to Listing component (instead of having it in Listing's
child Component)
- add default values to shortcut definition macro `shortcut_key_values`
- do not redefine default values in each `shortcuts` method after
getting all valid shortcuts from `context.settings.shortcuts.*.key_values()`
5 years ago
Manos Pitsidianakis 9c3284d3fe
ui/listings: add set_movement method to ListingComponent
Page movements is an enum that describes the movements of the keyboard
keys "Home, End, PageUp, PageDown". Some mail listing Components
interpret these keys as changes to their cursors.
5 years ago
Manos Pitsidianakis ea3f47fa44
ui: clear all state in Listing::set_coordinates
If a listing lists search results, ie when "filtering" with a filter
term, it sets up its state in filtered_selection, filtered_order etc.
set_coordinates() should reset that state.
5 years ago
Manos Pitsidianakis 6f816d29c5
conf: add ascii_drawing option
If set to true, box drawing is done with ascii characters.
5 years ago
Manos Pitsidianakis b25f10f92a
conf: add a light theme option 5 years ago
Manos Pitsidianakis 2b5472adc3
Add set_seen shortcut in CompactListing 5 years ago
Manos Pitsidianakis 31543bf2f9
ui: update CompactListing based on ConversationsListing 5 years ago
Manos Pitsidianakis 68c40a2920
melib: return Result with error when an IO operation fails
Don't unwrap anything because this might be temporary, for example a
short IMAP disconnection.
5 years ago
Manos Pitsidianakis fb7b038ee1
ui: add set_seen shortcut in {Compact,Conversation}
Shortcut sets an entire thread as seen.
5 years ago