diff options
author | Andreas Kling <awesomekling@gmail.com> | 2019-03-15 21:41:27 +0100 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-03-15 21:41:27 +0100 |
commit | b54ab065953e1642c0a1c3949a3536a46c9b0aba (patch) | |
tree | d7d3a92e95dcf3853d4087caf7b4c582e22fd517 /LibGUI/GTableView.cpp | |
parent | 491aa112ab817af2ce8107b449c92636d4e0f049 (diff) | |
download | serenity-b54ab065953e1642c0a1c3949a3536a46c9b0aba.zip |
GTableView: Add a way to turn off alternating row colors.
Diffstat (limited to 'LibGUI/GTableView.cpp')
-rw-r--r-- | LibGUI/GTableView.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/LibGUI/GTableView.cpp b/LibGUI/GTableView.cpp index d5212bed0f..d673fdccbf 100644 --- a/LibGUI/GTableView.cpp +++ b/LibGUI/GTableView.cpp @@ -157,8 +157,13 @@ void GTableView::paint_event(GPaintEvent& event) key_column_background_color = is_focused() ? Color::from_rgb(0x84351a) : Color::from_rgb(0x606060); text_color = Color::White; } else { - background_color = painted_item_index % 2 ? Color(210, 210, 210) : Color::White; - key_column_background_color = painted_item_index % 2 ? Color(190, 190, 190) : Color(235, 235, 235); + if (alternating_row_colors() && (painted_item_index % 2)) { + background_color = Color(210, 210, 210); + key_column_background_color = Color(190, 190, 190); + } else { + background_color = Color::White; + key_column_background_color = Color(235, 235, 235); + } text_color = Color::Black; } |