Browse Source

utilities: move PageMovement to components mod

jmap-eventsource
Manos Pitsidianakis 1 year ago
parent
commit
05ef863a45
Signed by: epilys GPG Key ID: 73627C2F690DF710
  1. 12
      src/components.rs
  2. 2
      src/components/mail/listing/compact.rs
  3. 2
      src/components/mail/listing/conversations.rs
  4. 2
      src/components/mail/listing/offline.rs
  5. 2
      src/components/mail/listing/plain.rs
  6. 2
      src/components/mail/listing/thread.rs
  7. 2
      src/components/mail/view/thread.rs
  8. 12
      src/components/utilities.rs

12
src/components.rs

@ -54,6 +54,18 @@ pub type ComponentId = Uuid;
pub type ShortcutMap = IndexMap<&'static str, Key>;
pub type ShortcutMaps = IndexMap<&'static str, ShortcutMap>;
#[derive(Debug, Clone, Copy)]
pub enum PageMovement {
Up(usize),
Right(usize),
Left(usize),
Down(usize),
PageUp(usize),
PageDown(usize),
Home,
End,
}
/// Types implementing this Trait can draw on the terminal and receive events.
/// If a type wants to skip drawing if it has not changed anything, it can hold some flag in its
/// fields (eg self.dirty = false) and act upon that in their `draw` implementation.

2
src/components/mail/listing/compact.rs

@ -21,7 +21,7 @@
use super::EntryStrings;
use super::*;
use crate::components::utilities::PageMovement;
use crate::components::PageMovement;
use crate::jobs::JoinHandle;
use std::cmp;
use std::convert::TryInto;

2
src/components/mail/listing/conversations.rs

@ -20,7 +20,7 @@
*/
use super::*;
use crate::components::utilities::PageMovement;
use crate::components::PageMovement;
use crate::jobs::JoinHandle;
use std::iter::FromIterator;

2
src/components/mail/listing/offline.rs

@ -20,7 +20,7 @@
*/
use super::*;
use crate::components::utilities::PageMovement;
use crate::components::PageMovement;
#[derive(Debug)]
pub struct OfflineListing {

2
src/components/mail/listing/plain.rs

@ -21,7 +21,7 @@
use super::EntryStrings;
use super::*;
use crate::components::utilities::PageMovement;
use crate::components::PageMovement;
use crate::jobs::{JobId, JoinHandle};
use std::cmp;
use std::iter::FromIterator;

2
src/components/mail/listing/thread.rs

@ -20,7 +20,7 @@
*/
use super::*;
use crate::components::utilities::PageMovement;
use crate::components::PageMovement;
use std::cmp;
use std::convert::TryInto;

2
src/components/mail/view/thread.rs

@ -20,7 +20,7 @@
*/
use super::*;
use crate::components::utilities::PageMovement;
use crate::components::PageMovement;
use std::cmp;
#[derive(Debug, Clone)]

12
src/components/utilities.rs

@ -36,18 +36,6 @@ pub use self::layouts::*;
use crate::jobs::JobId;
use std::collections::HashSet;
#[derive(Debug, Clone, Copy)]
pub enum PageMovement {
Up(usize),
Right(usize),
Left(usize),
Down(usize),
PageUp(usize),
PageDown(usize),
Home,
End,
}
#[derive(Default, Debug, Clone)]
pub struct SearchPattern {
pattern: String,

Loading…
Cancel
Save