mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 11:58:12 +00:00
GListView: Fix for theme support. We have to use theme colors.
This commit is contained in:
parent
e50deb55d3
commit
71922ee6a5
1 changed files with 8 additions and 6 deletions
|
@ -107,12 +107,14 @@ void GListView::paint_event(GPaintEvent& event)
|
||||||
|
|
||||||
Color background_color;
|
Color background_color;
|
||||||
if (is_selected_row) {
|
if (is_selected_row) {
|
||||||
background_color = is_focused() ? palette().selection_text() : Color::from_rgb(0x606060);
|
background_color = is_focused() ? palette().selection() : Color::from_rgb(0x606060);
|
||||||
} else {
|
} else {
|
||||||
if (alternating_row_colors() && (painted_item_index % 2))
|
Color row_fill_color = palette().color(background_role());
|
||||||
background_color = Color(210, 210, 210);
|
if (alternating_row_colors() && (painted_item_index % 2)) {
|
||||||
else
|
background_color = row_fill_color.darkened(0.8f);
|
||||||
background_color = palette().color(background_role());
|
} else {
|
||||||
|
background_color = row_fill_color;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
auto column_metadata = model()->column_metadata(m_model_column);
|
auto column_metadata = model()->column_metadata(m_model_column);
|
||||||
|
@ -130,7 +132,7 @@ void GListView::paint_event(GPaintEvent& event)
|
||||||
} else {
|
} else {
|
||||||
Color text_color;
|
Color text_color;
|
||||||
if (is_selected_row)
|
if (is_selected_row)
|
||||||
text_color = Color::White;
|
text_color = palette().selection_text();
|
||||||
else
|
else
|
||||||
text_color = model()->data(index, GModel::Role::ForegroundColor).to_color(palette().color(foreground_role()));
|
text_color = model()->data(index, GModel::Role::ForegroundColor).to_color(palette().color(foreground_role()));
|
||||||
auto text_rect = row_rect;
|
auto text_rect = row_rect;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue