mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-21 01:40:46 +00:00
HexEditor: Remove magic color constant for modified bytes
The magic constant does not work together well with themes. As there does not seem to be a suitable palette color for this, simply invert the color.
This commit is contained in:
parent
41edc21a8e
commit
6b5456f132
Notes:
sideshowbarker
2024-07-18 01:39:37 +09:00
Author: https://github.com/standardexe
Commit: 6b5456f132
Pull-request: https://github.com/SerenityOS/serenity/pull/10202
Reviewed-by: https://github.com/kleinesfilmroellchen ✅
Reviewed-by: https://github.com/metmo
1 changed files with 4 additions and 4 deletions
|
@ -574,8 +574,8 @@ void HexEditor::paint_event(GUI::PaintEvent& event)
|
||||||
Gfx::Color text_color = edited_flag ? Color::Red : palette().color(foreground_role());
|
Gfx::Color text_color = edited_flag ? Color::Red : palette().color(foreground_role());
|
||||||
|
|
||||||
if (highlight_flag) {
|
if (highlight_flag) {
|
||||||
background_color = palette().selection();
|
background_color = edited_flag ? palette().selection().inverted() : palette().selection();
|
||||||
text_color = edited_flag ? Color::from_rgb(0xFFC0CB) : palette().selection_text();
|
text_color = edited_flag ? palette().selection_text().inverted() : palette().selection_text();
|
||||||
} else if (byte_position == m_position && m_edit_mode == EditMode::Text) {
|
} else if (byte_position == m_position && m_edit_mode == EditMode::Text) {
|
||||||
background_color = palette().inactive_selection();
|
background_color = palette().inactive_selection();
|
||||||
text_color = palette().inactive_selection_text();
|
text_color = palette().inactive_selection_text();
|
||||||
|
@ -605,8 +605,8 @@ void HexEditor::paint_event(GUI::PaintEvent& event)
|
||||||
text_color = edited_flag ? Color::Red : palette().color(foreground_role());
|
text_color = edited_flag ? Color::Red : palette().color(foreground_role());
|
||||||
|
|
||||||
if (highlight_flag) {
|
if (highlight_flag) {
|
||||||
background_color = palette().selection();
|
background_color = edited_flag ? palette().selection().inverted() : palette().selection();
|
||||||
text_color = edited_flag ? Color::from_rgb(0xFFC0CB) : palette().selection_text();
|
text_color = edited_flag ? palette().selection_text().inverted() : palette().selection_text();
|
||||||
} else if (byte_position == m_position && m_edit_mode == EditMode::Hex) {
|
} else if (byte_position == m_position && m_edit_mode == EditMode::Hex) {
|
||||||
background_color = palette().inactive_selection();
|
background_color = palette().inactive_selection();
|
||||||
text_color = palette().inactive_selection_text();
|
text_color = palette().inactive_selection_text();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue