Skip to content

Commit

Permalink
Changes to UI
Browse files Browse the repository at this point in the history
* Fixed size for Anki not running dialog and always show text
* Add easier navigation for tags window
* Allow deleting tags
* Refresh menu after leaving editor
  • Loading branch information
btrkeks committed Oct 24, 2024
1 parent ab5fd81 commit 8cc4ace
Show file tree
Hide file tree
Showing 4 changed files with 132 additions and 165 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ serde_json = "1.0.128"
thiserror = "1.0.64"
base64 = "0.22.1"
serde = { version = "1.0.210", features = ["derive"] }
ratatui = "0.28.1"
ratatui = "0.29.0"

[package.metadata.spellcheck]
config = "spellcheck.toml"
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,12 @@ map <key> exec "bookminer --book-filename \"$FILE\" --page-number \"$PAGE\""

### TODO
#### Short-term
- [ ] Allow deleting tags
- [ ] Take screenshot only of the focused window (Or atleast the focused monitor)
- [ ] Handle space in tags
- [ ] Display the currently selected Anki settings in the final menu
- [ ] Integrate with Okular using their [D-Bus API](https://docs.kde.org/trunk5/en/kid3/kid3/dbus-api.html)
- [ ] Pressing space in the tag selection should advance to the next tag
- [ ] Try to detect wrong Anki settings (parse AnkiConnect error and act accordingly)
- [ ] Search tags

#### Long-term
- [ ] LaTeX lint on the fly?
Expand Down
4 changes: 2 additions & 2 deletions src/menu_actions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,12 @@ impl MenuAction for EditAnkiSettings {
}

fn act(&mut self, state: &mut ApplicationState) -> Result<()> {
let settings = vec!["deck", "note type", "mapping", "cancel"];
let settings = vec!["Deck", "Note Type", "Field Mapping", "Return"];

loop {
let selection = state
.tui
.show_single_selection_menu("Choose the setting to change", &settings)?;
.show_single_selection_menu("Choose which setting to change", &settings)?;

match selection {
0 => self.edit_deck(state)?,
Expand Down
Loading

0 comments on commit 8cc4ace

Please sign in to comment.