Skip to content

Commit

Permalink
Apply Nerd Font icons to NoteTree (#101)
Browse files Browse the repository at this point in the history
  • Loading branch information
panarch authored Jan 13, 2025
1 parent 9acb4d2 commit 9be1294
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions tui/src/views/body/notebook/note_tree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@ use {
},
};

const CLOSED_SYMBOL: &str = "▶ ";
const OPEN_SYMBOL: &str = "▼ ";
const CLOSED_SYMBOL: &str = "󰉋 ";
const OPEN_SYMBOL: &str = "󰝰 ";
const NOTE_SYMBOL: &str = "󱇗 ";

pub fn draw(frame: &mut Frame, area: Rect, context: &mut NotebookContext) {
let note_tree_focused = matches!(
Expand All @@ -38,8 +39,8 @@ pub fn draw(frame: &mut Frame, area: Rect, context: &mut NotebookContext) {
}| {
match kind {
TreeItemKind::Note { note } => {
let pad = depth * 2 + 2;
let line = Line::raw(format!("{:pad$}{}", "", note.name));
let pad = depth * 2;
let line = Line::raw(format!("{:pad$}{NOTE_SYMBOL}{}", "", note.name));

match (selectable, target) {
(true, _) => line,
Expand Down

0 comments on commit 9be1294

Please sign in to comment.