Improve identification of Overlays

This commit is contained in:
jaby 2023-08-24 00:24:20 +02:00
parent 41c6b693d3
commit a20483f51d
1 changed files with 22 additions and 7 deletions

View File

@ -413,12 +413,24 @@ impl ConsoleUI {
let section_list = List::new(data.section_info.iter().map(
|section| {
let mut new_item = ListItem::new(section.name.clone());
if let Some(color) = section.color_share {
new_item = new_item.style(Style::default().fg(color));
}
new_item
ListItem::new(Line::from(vec![{
if let Some(color) = section.color_share {
Span::styled("*", Style::default().fg(color))
}
else {
Span::raw("")
}
},
Span::raw(
if section.is_global {
String::from("<GLOBAL>")
}
else {
section.name.clone()
}
)
]))
}).collect::<Vec<_>>()).style(Style::default().fg(Color::White))
.block(Self::create_default_border("Section"))
.highlight_style(Style::default().add_modifier(Modifier::REVERSED|Modifier::BOLD));
@ -547,6 +559,7 @@ impl ConsoleUIData {
size: program_size,
max_size: Self::RAM_SIZE,
color_share: None,
is_global: true
});
for section in memory_map.sections {
@ -557,6 +570,7 @@ impl ConsoleUIData {
size: section.size,
max_size: program_size,
color_share: None,
is_global: false
});
}
@ -594,7 +608,8 @@ struct SectionInfo {
pub start_adr: u64,
pub size: usize,
pub max_size: usize,
pub color_share: Option<Color>
pub color_share: Option<Color>,
pub is_global: bool,
}
impl SectionInfo {