Skip to content

Commit

Permalink
add new task shortcut with 'n' key
Browse files Browse the repository at this point in the history
  • Loading branch information
4DA committed Nov 21, 2021
1 parent cfdeb2a commit 0d9e19f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@ minimalistic time tracker with simple pomodoro timer
![screenshot](screenshot.png)

# Usage
## task list
- up/down arrow : select task
- spacebar : start tracking, pause, switch to other task
- escae : stop tracking
- escape : stop tracking
- right mouse button : task context menu
- "n" key : add new task

# Program data
Program settings and tasks are stored user's config directory:
Expand Down
6 changes: 5 additions & 1 deletion src/task_list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,11 @@ impl Widget<(AppModel, Vector<String>)> for TaskListWidget {
TrackingState::Active(_) => stop_tracking(&mut data.0, TrackingState::Inactive),
_ => data.0.tracking.state = TrackingState::Inactive,
}
}
},

Event::KeyUp(key) if key.code == druid::Code::KeyN => {
ctx.submit_command(COMMAND_TASK_NEW.with(()));
},

_ => self.inner.event(ctx, event, data, _env),
}
Expand Down

0 comments on commit 0d9e19f

Please sign in to comment.