summaryrefslogtreecommitdiff
path: root/LibGUI/GTableView.cpp
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2019-03-15 21:41:27 +0100
committerAndreas Kling <awesomekling@gmail.com>2019-03-15 21:41:27 +0100
commitb54ab065953e1642c0a1c3949a3536a46c9b0aba (patch)
treed7d3a92e95dcf3853d4087caf7b4c582e22fd517 /LibGUI/GTableView.cpp
parent491aa112ab817af2ce8107b449c92636d4e0f049 (diff)
downloadserenity-b54ab065953e1642c0a1c3949a3536a46c9b0aba.zip
GTableView: Add a way to turn off alternating row colors.
Diffstat (limited to 'LibGUI/GTableView.cpp')
-rw-r--r--LibGUI/GTableView.cpp9
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;
}