mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 08:27:45 +00:00
HexEditor: Make edited bytes bold
This will help them still stand out once we introduce annotations, which also modify the colors.
This commit is contained in:
parent
27adbd1792
commit
da52c5e82a
1 changed files with 7 additions and 6 deletions
|
@ -674,6 +674,7 @@ void HexEditor::paint_event(GUI::PaintEvent& event)
|
||||||
return palette().color(foreground_role());
|
return palette().color(foreground_role());
|
||||||
}();
|
}();
|
||||||
Gfx::Color text_color_text = text_color_hex;
|
Gfx::Color text_color_text = text_color_hex;
|
||||||
|
auto& font = edited_flag ? this->font().bold_variant() : this->font();
|
||||||
|
|
||||||
if (highlight_flag) {
|
if (highlight_flag) {
|
||||||
background_color_hex = background_color_text = edited_flag ? palette().selection().inverted() : palette().selection();
|
background_color_hex = background_color_text = edited_flag ? palette().selection().inverted() : palette().selection();
|
||||||
|
@ -709,11 +710,11 @@ void HexEditor::paint_event(GUI::PaintEvent& event)
|
||||||
draw_cursor_rect();
|
draw_cursor_rect();
|
||||||
|
|
||||||
if (byte_position == m_position && !edited_flag) {
|
if (byte_position == m_position && !edited_flag) {
|
||||||
painter.draw_text(hex_display_rect_high_nibble, high_nibble, Gfx::TextAlignment::TopLeft, m_cursor_at_low_nibble ? text_color_hex : palette().selection_text());
|
painter.draw_text(hex_display_rect_high_nibble, high_nibble, font, Gfx::TextAlignment::TopLeft, m_cursor_at_low_nibble ? text_color_hex : palette().selection_text());
|
||||||
painter.draw_text(hex_display_rect_low_nibble, low_nibble, Gfx::TextAlignment::TopLeft, m_cursor_at_low_nibble ? palette().selection_text() : text_color_hex);
|
painter.draw_text(hex_display_rect_low_nibble, low_nibble, font, Gfx::TextAlignment::TopLeft, m_cursor_at_low_nibble ? palette().selection_text() : text_color_hex);
|
||||||
} else {
|
} else {
|
||||||
painter.draw_text(hex_display_rect_high_nibble, high_nibble, Gfx::TextAlignment::TopLeft, text_color_hex);
|
painter.draw_text(hex_display_rect_high_nibble, high_nibble, font, Gfx::TextAlignment::TopLeft, text_color_hex);
|
||||||
painter.draw_text(hex_display_rect_low_nibble, low_nibble, Gfx::TextAlignment::TopLeft, text_color_hex);
|
painter.draw_text(hex_display_rect_low_nibble, low_nibble, font, Gfx::TextAlignment::TopLeft, text_color_hex);
|
||||||
}
|
}
|
||||||
|
|
||||||
Gfx::IntRect text_background_rect {
|
Gfx::IntRect text_background_rect {
|
||||||
|
@ -731,9 +732,9 @@ void HexEditor::paint_event(GUI::PaintEvent& event)
|
||||||
char const character = is_ascii_printable(cell_value) ? cell_value : '.';
|
char const character = is_ascii_printable(cell_value) ? cell_value : '.';
|
||||||
auto character_sv = StringView { &character, 1 };
|
auto character_sv = StringView { &character, 1 };
|
||||||
if (byte_position == m_position)
|
if (byte_position == m_position)
|
||||||
painter.draw_text(text_display_rect, character_sv, Gfx::TextAlignment::TopLeft, palette().selection_text());
|
painter.draw_text(text_display_rect, character_sv, font, Gfx::TextAlignment::TopLeft, palette().selection_text());
|
||||||
else
|
else
|
||||||
painter.draw_text(text_display_rect, character_sv, Gfx::TextAlignment::TopLeft, text_color_text);
|
painter.draw_text(text_display_rect, character_sv, font, Gfx::TextAlignment::TopLeft, text_color_text);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue