mirror of
https://github.com/kdheepak/taskwarrior-tui.git
synced 2025-08-24 23:46:41 +02:00
Change Command to Filter
This commit is contained in:
parent
d796c69d9f
commit
0ee8d7be3b
1 changed files with 5 additions and 5 deletions
10
src/app.rs
10
src/app.rs
|
@ -62,7 +62,7 @@ pub fn vague_format_date_time(dt: &Date) -> String {
|
||||||
|
|
||||||
pub enum AppMode {
|
pub enum AppMode {
|
||||||
Report,
|
Report,
|
||||||
Command,
|
Filter,
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct App {
|
pub struct App {
|
||||||
|
@ -106,7 +106,7 @@ impl App {
|
||||||
self.draw_command(f, rects[2]);
|
self.draw_command(f, rects[2]);
|
||||||
match self.mode {
|
match self.mode {
|
||||||
AppMode::Report => (),
|
AppMode::Report => (),
|
||||||
AppMode::Command => {
|
AppMode::Filter => {
|
||||||
// Make the cursor visible and ask tui-rs to put it at the specified coordinates after rendering
|
// Make the cursor visible and ask tui-rs to put it at the specified coordinates after rendering
|
||||||
f.set_cursor(
|
f.set_cursor(
|
||||||
// Put cursor past the end of the input text
|
// Put cursor past the end of the input text
|
||||||
|
@ -120,7 +120,7 @@ impl App {
|
||||||
|
|
||||||
fn draw_command(&mut self, f: &mut Frame<impl Backend>, rect: Rect) {
|
fn draw_command(&mut self, f: &mut Frame<impl Backend>, rect: Rect) {
|
||||||
let p = Paragraph::new(Text::from(&self.filter[..]))
|
let p = Paragraph::new(Text::from(&self.filter[..]))
|
||||||
.block(Block::default().borders(Borders::ALL).title("Command"));
|
.block(Block::default().borders(Borders::ALL).title("Filter"));
|
||||||
f.render_widget(p, rect);
|
f.render_widget(p, rect);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -388,11 +388,11 @@ impl App {
|
||||||
Key::Down | Key::Char('j') => self.next(),
|
Key::Down | Key::Char('j') => self.next(),
|
||||||
Key::Up | Key::Char('k') => self.previous(),
|
Key::Up | Key::Char('k') => self.previous(),
|
||||||
Key::Char('/') => {
|
Key::Char('/') => {
|
||||||
self.mode = AppMode::Command;
|
self.mode = AppMode::Filter;
|
||||||
}
|
}
|
||||||
_ => {}
|
_ => {}
|
||||||
},
|
},
|
||||||
AppMode::Command => match event {
|
AppMode::Filter => match event {
|
||||||
Key::Char('\n') | Key::Esc => {
|
Key::Char('\n') | Key::Esc => {
|
||||||
self.mode = AppMode::Report;
|
self.mode = AppMode::Report;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue