Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions docs/gui.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,25 +39,25 @@ There are three main views:

1. *Help view*: Shows available commands.

Use <kbd>Tab</kbd> to switch between the first two views, and <kbd>Ctrl+h</kbd> for help.
Use <kbd>Tab</kbd> to switch between the first two views, and <kbd>^h</kbd> for help.

* <kbd>Enter</kbd>: Go to selected directory

* <kbd>Esc</kbd> or <kbd>Ctrl+q</kbd>: Exit and stay in the current directory
* <kbd>Esc</kbd> or <kbd>^q</kbd>: Exit and stay in the current directory

* <kbd>Up/Down</kbd>: Select directory (<kbd>Shift</kbd> for bigger jumps)

* <kbd>Page Up/Page Down</kbd>: Scroll by page

* <kbd>Home</kbd>: Go to most recent directory (the top)

* <kbd>Ctrl+a</kbd>: Show full directory path (the full path is shown instead of the shortcut names), or switch back to shortcut usage.
* <kbd>^a</kbd>: Show full directory path (the full path is shown instead of the shortcut names), or switch back to shortcut usage.

* <kbd>Ctrl+d</kbd>: Delete selected entry
* <kbd>^d</kbd>: Delete selected entry

* <kbd>Ctrl+e</kbd> (shortcuts view): Edit description
* <kbd>^e</kbd> (shortcuts view): Edit description

* <kbd>Ctrl+f</kbd> Switch between exact and fuzzy search
* <kbd>^f</kbd> Switch between exact and fuzzy search

* <kbd>F12</kbd>: Open the configuration view

Expand Down
162 changes: 76 additions & 86 deletions src/help.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,13 @@ impl View for Help {

let layout = Layout::vertical([
Constraint::Fill(1),
Constraint::Length(19),
Constraint::Length(18),
Constraint::Fill(1),
]);
let chunks: [Rect; 3] = layout.areas(modal_area);
let center_layout = Layout::horizontal([
Constraint::Fill(1),
Constraint::Length(100),
Constraint::Length(74),
Constraint::Fill(1),
]);
let chunks: [Rect; 3] = center_layout.areas(chunks[1]);
Expand All @@ -59,90 +59,80 @@ impl View for Help {
let es = styles.text_em_style;

let message = Paragraph::new(vec![
Line::from(vec![
Span::styled("Use ", ts),
Span::styled("tab", es),
Span::styled(" to switch between the views.", ts),
]),
Line::from(vec![
Span::styled("Use ", ts),
Span::styled("enter", es),
Span::styled(" to exit the GUI and go into the selected directory;", ts),
]),
Line::from(vec![
Span::styled("Use ", ts),
Span::styled("esc or ctrl+q", es),
Span::styled(" to simply exit and stay in the current directory.", ts),
]),
Line::from(vec![
Span::styled("Use the ", ts),
Span::styled("up", es),
Span::styled(" and ", ts),
Span::styled("down", es),
Span::styled(" arrow keys to select a directory (", ts),
Span::styled("shift", es),
Span::styled(" for bigger jumps);", ts),
]),
Line::from(vec![
Span::styled("Use ", ts),
Span::styled("page up", es),
Span::styled(" and ", ts),
Span::styled("page down", es),
Span::styled(" to scroll through the list by page;", ts),
]),
Line::from(vec![
Span::styled("Use ", ts),
Span::styled("home", es),
Span::styled(
" to go to the most recent directory in the history (the top);",
ts,
),
]),
Line::from(vec![
Span::styled("Use ", ts),
Span::styled("ctrl+a", es),
Span::styled(" to see the full directory path without shortcuts, or switch back to shortcut usage.", ts),
]),
Line::from(vec![
Span::styled("Use ", ts),
Span::styled("ctrl+d", es),
Span::styled(" to delete the selected entry.", ts),
]),
Line::from(vec![
Span::styled("Use ", ts),
Span::styled("ctrl+e", es),
Span::styled(" to edit a shortcut description.", ts),
]),
Line::from(vec![
Span::styled("Use ", ts),
Span::styled("ctrl+f", es),
Span::styled(" to switch between exact and fuzzy search.", ts),
]),
Line::from(vec![
Span::styled("Use ", ts),
Span::styled("ctrl+h", es),
Span::styled(" for the help screen.", ts),
]),
Line::from(vec![
Span::styled("Use ", ts),
Span::styled("F12", es),
Span::styled(" to open the configuration view.", ts),
]),
Line::from(""),
Line::from(vec![Span::styled("Enter a text to filter.", ts)]),
Line::from(""),
Line::from(vec![
Span::styled("Use ", ts),
Span::styled("esc", es),
Span::styled(" to close this window.", ts),
]),
])
.block(
Block::default()
.padding(Padding::new(1, 1, 1, 1))
.title(Span::styled(" cdir help ", styles.title_style))
.borders(Borders::ALL)
);
Line::from(vec![
Span::styled("tab", es),
Span::styled(" to switch between the views.", ts),
]),
Line::from(vec![
Span::styled("enter", es),
Span::styled(" to exit the GUI and go into the selected directory.", ts),
]),
Line::from(vec![
Span::styled("esc or ^+q", es),
Span::styled(" to simply exit and stay in the current directory.", ts),
]),
Line::from(vec![
Span::styled("up", es),
Span::styled(" and ", ts),
Span::styled("down", es),
Span::styled(" arrow keys to select a directory (", ts),
Span::styled("shift", es),
Span::styled(" for bigger jumps).", ts),
]),
Line::from(vec![
Span::styled("page up", es),
Span::styled(" and ", ts),
Span::styled("page down", es),
Span::styled(" to scroll through the list by page.", ts),
]),
Line::from(vec![
Span::styled("home", es),
Span::styled(
" to go to the most recent directory in the history (the top).",
ts,
),
]),
Line::from(vec![
Span::styled("^a", es),
Span::styled(
" to switch between full directory path and shortcuts usage.",
ts,
),
]),
Line::from(vec![
Span::styled("^d", es),
Span::styled(" to delete the selected entry.", ts),
]),
Line::from(vec![
Span::styled("^e", es),
Span::styled(" to edit a shortcut description.", ts),
]),
Line::from(vec![
Span::styled("^f", es),
Span::styled(" to switch between exact and fuzzy search.", ts),
]),
Line::from(vec![
Span::styled("^h", es),
Span::styled(" for the help screen.", ts),
]),
Line::from(vec![
Span::styled("F12", es),
Span::styled(" to open the configuration view.", ts),
]),
Line::from(""),
Line::from(vec![Span::styled("Enter a text to filter.", ts)]),
Line::from(""),
Line::from(vec![
Span::styled("esc", es),
Span::styled(" to close this window.", ts),
]),
])
.block(
Block::default()
.padding(Padding::new(1, 1, 1, 1))
.title(Span::styled(" cdir help ", styles.title_style))
.borders(Borders::ALL),
);

// Fill the frame with the background color if defined
if let Some(bg_color) = &styles.background_color {
Expand Down
2 changes: 1 addition & 1 deletion src/history_view_container.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ impl View for HistoryViewContainer {

let horizontal = Layout::horizontal([
Constraint::Fill(1),
Constraint::Length(14),
Constraint::Length(10),
Constraint::Length(1),
Constraint::Length(12),
])
Expand Down
2 changes: 1 addition & 1 deletion src/list_indicator_view.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ impl View for ListIndicatorView {
.bg(Color::Red)
.alignment(Alignment::Center)
} else {
Paragraph::new("ctrl+h: help")
Paragraph::new("^h: help")
.style(
Style::default()
.bg(config_lock.styles.header_bg_color.unwrap())
Expand Down
2 changes: 1 addition & 1 deletion src/shortcut_view_container.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ impl View for ShortcutViewContainer {

let horizontal = Layout::horizontal([
Constraint::Fill(1),
Constraint::Length(14),
Constraint::Length(10),
Constraint::Length(1),
Constraint::Length(12),
])
Expand Down