summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorClement Tsang <34804052+ClementTsang@users.noreply.github.com>2022-09-03 04:04:03 -0400
committerGitHub <noreply@github.com>2022-09-03 04:04:03 -0400
commit46a2a3a52b837512280384d7b03e4718e504b4a6 (patch)
tree46b494b3a8de31549d0a3b713bae8ba48a73ab95 /src
parent726e727de6c67b857efaa0ebacf25fa662cd4495 (diff)
other: Clarify help menu (#800)
* other: clarify that numbers are for help menu * bug: fix incorrect overscroll check, should be min
Diffstat (limited to 'src')
-rw-r--r--src/canvas.rs6
-rw-r--r--src/canvas/dialogs/help_dialog.rs4
-rw-r--r--src/constants.rs2
3 files changed, 6 insertions, 6 deletions
diff --git a/src/canvas.rs b/src/canvas.rs
index 3a3549a2..4a834ae4 100644
--- a/src/canvas.rs
+++ b/src/canvas.rs
@@ -333,9 +333,9 @@ impl Painter {
]
} else {
[
- Constraint::Percentage(20),
- Constraint::Percentage(60),
- Constraint::Percentage(20),
+ Constraint::Percentage(15),
+ Constraint::Percentage(70),
+ Constraint::Percentage(15),
]
})
.split(vertical_dialog_chunk[1]);
diff --git a/src/canvas/dialogs/help_dialog.rs b/src/canvas/dialogs/help_dialog.rs
index b125e73f..c315bc8c 100644
--- a/src/canvas/dialogs/help_dialog.rs
+++ b/src/canvas/dialogs/help_dialog.rs
@@ -1,4 +1,4 @@
-use std::cmp::max;
+use std::cmp::{max, min};
use unicode_width::UnicodeWidthStr;
@@ -88,7 +88,7 @@ impl Painter {
.scroll_state
.current_scroll_index;
- *index = max(*index, *max_scroll_index);
+ *index = min(*index, *max_scroll_index);
}
f.render_widget(
diff --git a/src/constants.rs b/src/constants.rs
index a10b766b..0d073423 100644
--- a/src/constants.rs
+++ b/src/constants.rs
@@ -219,7 +219,7 @@ pub static NORD_LIGHT_COLOUR_PALETTE: Lazy<ConfigColours> = Lazy::new(|| ConfigC
// Help text
pub const HELP_CONTENTS_TEXT: [&str; 8] = [
- "Press the corresponding numbers to jump to the section, or scroll:",
+ "Either scroll or press the number key to go to the corresponding help menu section:",
"1 - General",
"2 - CPU widget",
"3 - Process widget",