Add help charcters

This commit is contained in:
Jaby Blubb 2023-08-16 15:31:16 +02:00
parent f74762f0b0
commit b985281789
1 changed files with 8 additions and 5 deletions

View File

@ -288,8 +288,8 @@ impl ConsoleUI {
)
.highlight_style(Style::default().bg(HIGHLIGHT_COLOR[section_selection.get_section_mode_id()]));
let first_mem_gauge = Self::create_mem_gauge_from(&data.section_info[section_selection.get_selection_for(SectionMode::UpperSection)], HIGHLIGHT_COLOR[0]);
let second_mem_gauge = Self::create_mem_gauge_from(&data.section_info[section_selection.get_selection_for(SectionMode::LowerSection)], HIGHLIGHT_COLOR[1]);
let first_mem_gauge = Self::create_mem_gauge_from(&data.section_info[section_selection.get_selection_for(SectionMode::UpperSection)], "a", HIGHLIGHT_COLOR[0]);
let second_mem_gauge = Self::create_mem_gauge_from(&data.section_info[section_selection.get_selection_for(SectionMode::LowerSection)], "s", HIGHLIGHT_COLOR[1]);
let mut list_state = ListState::default();
list_state.select(Some(section_selection.get_current_selection()));
@ -299,7 +299,7 @@ impl ConsoleUI {
frame.render_widget(second_mem_gauge, layout[2]);
}
fn create_mem_gauge_from<'a>(section_info: &SectionInfo, color: Color) -> Gauge<'a> {
fn create_mem_gauge_from<'a>(section_info: &SectionInfo, string: &'a str, color: Color) -> Gauge<'a> {
const PERCISION:usize = 5;
const FLOAT_DISPLAY_LIMIT:f64 = {
let mut base = 1.0f64;
@ -315,8 +315,11 @@ impl ConsoleUI {
let adr_ratio = section_info.get_size_ratio();
Gauge::default().block(Block::default().borders(Borders::ALL)
.title(format!("{} @0x{:x} - 0x{:x} [{}b/{}b]",
section_info.name, section_info.start_adr, section_info.get_end_adr(), section_info.size, section_info.max_size)))
.title(Line::from(vec![
Span::styled(string, Style::default().fg(color)),
Span::raw(format!(": {} @0x{:x} - 0x{:x} [{}b/{}b]",
section_info.name, section_info.start_adr, section_info.get_end_adr(), section_info.size, section_info.max_size)),
])))
.gauge_style(Style::default().fg(color).bg(Color::Black).add_modifier(Modifier::BOLD))
.ratio(adr_ratio).label({
let adr_ratio = adr_ratio*100.0f64;