App

Struct App 

Source
pub struct App {
    pub title: String,
    pub should_quit: bool,
    pub day: DayPlan,
    pub config: Config,
    /* private fields */
}

Fields§

§title: String§should_quit: bool§day: DayPlan§config: Config

Implementations§

Source§

impl App

Source

pub fn new() -> Self

Source

pub fn with_config(config: Config) -> Self

Source

pub fn handle_key(&mut self, code: KeyCode)

Source

pub fn handle_key_event(&mut self, ev: KeyEvent)

Source

pub fn handle_mouse_event(&mut self, ev: MouseEvent, area: Rect)

Handle mouse events using the current terminal area to map coordinates to UI regions.

  • Left click on a list row selects that task; double-click toggles start/pause.
  • Right click on a list row opens estimate edit.
  • Clicking tabs switches views.
  • Mouse move updates hover index.
  • Ignores clicks while in input/popup modes.
Source

pub fn handle_mouse_move(&mut self, col: u16, row: u16, area: Rect)

For tests: update hover by coordinates without constructing a MouseEvent.

Source

pub fn handle_paste(&mut self, s: &str)

Handle pasted text from the terminal (bracketed/kitty paste etc.). Appends to the input buffer only when in input mode.

Source

pub fn add_task(&mut self, title: &str, estimate_min: u16) -> usize

Source

pub fn finish_active(&mut self)

Source

pub fn finish_selected(&mut self)

Finish the currently selected task regardless of its active state.

Source

pub fn selected_index(&self) -> usize

Source

pub fn select_up(&mut self)

Source

pub fn select_down(&mut self)

Source

pub fn postpone_selected(&mut self)

Source

pub fn bring_selected_from_future(&mut self)

Bring a task from Future to Today (mirror of postpone). No-op unless in Future view.

Source

pub fn tomorrow_tasks(&self) -> &Vec<Task>

Source

pub fn history_tasks(&self) -> &Vec<Task>

Source

pub fn view(&self) -> View

Source

pub fn display_mode(&self) -> DisplayMode

Source

pub fn in_input_mode(&self) -> bool

Source

pub fn input_buffer(&self) -> Option<&str>

Source

pub fn is_estimate_editing(&self) -> bool

Source

pub fn is_new_task_estimate(&self) -> bool

Source

pub fn is_command_mode(&self) -> bool

Source

pub fn is_confirm_delete(&self) -> bool

Source

pub fn is_category_picker(&self) -> bool

Source

pub fn is_start_time_edit(&self) -> bool

Source

pub fn is_text_input_mode(&self) -> bool

True only when typing a task title (Normal/Interrupt), not for estimate/confirm popups.

Source

pub fn selected_estimate(&self) -> Option<u16>

Source

pub fn new_task_title(&self) -> Option<&str>

Source

pub fn new_task_default_estimate(&self) -> Option<u16>

Source

pub fn new_task_planned_ymd(&self) -> Option<u32>

Source

pub fn hovered_index(&self) -> Option<usize>

Source

pub fn is_dragging(&self) -> bool

Source

pub fn drag_source_index(&self) -> Option<usize>

Source

pub fn pulse_on(&self) -> bool

Source

pub fn hovered_tab_index(&self) -> Option<usize>

Source

pub fn popup_hover_button(&self) -> Option<PopupButton>

Source

pub fn hovered_header_button(&self) -> Option<HeaderButton>

Source

pub fn category_pick_index(&self) -> usize

Source

pub fn toggle_display_mode(&mut self)

Source

pub fn tick(&mut self, seconds: u16)

Source§

impl App

Source

pub fn apply_snapshot( &mut self, today: Vec<Task>, future: Vec<Task>, past: Vec<Task>, )

Replace task lists from an external snapshot.

  • Resets selection and carry seconds; keeps config.
Source§

impl App

Source

pub fn sweep_done_before(&mut self, ymd: u32)

Move any Today tasks with done_ymd strictly before ymd to history.

Trait Implementations§

Source§

impl Debug for App

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for App

Source§

fn default() -> App

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl Freeze for App

§

impl RefUnwindSafe for App

§

impl Send for App

§

impl Sync for App

§

impl Unpin for App

§

impl UnwindSafe for App

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.