diff options
author | Andreas Kling <awesomekling@gmail.com> | 2019-02-28 11:04:03 +0100 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-02-28 11:04:03 +0100 |
commit | 40c8dd80d1d51809f3a7c6426c3514f034fbeb93 (patch) | |
tree | 942fcedb549eb9c91c0d64e07573deff3a61c337 /LibGUI/GTableView.cpp | |
parent | dc9f8a936158b586362cee689b26e095074e59bc (diff) | |
download | serenity-40c8dd80d1d51809f3a7c6426c3514f034fbeb93.zip |
LibGUI: Draw separators between GTableView column headers.
Diffstat (limited to 'LibGUI/GTableView.cpp')
-rw-r--r-- | LibGUI/GTableView.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/LibGUI/GTableView.cpp b/LibGUI/GTableView.cpp index 0f98f1eac8..b2c4011128 100644 --- a/LibGUI/GTableView.cpp +++ b/LibGUI/GTableView.cpp @@ -103,9 +103,11 @@ void GTableView::paint_event(GPaintEvent&) painter.fill_rect({ 0, 0, width(), header_height() }, Color::LightGray); int x_offset = 0; for (int column_index = 0; column_index < m_model->column_count(); ++column_index) { - Rect cell_rect(horizontal_padding + x_offset, 0, m_model->column_width(column_index), item_height()); - painter.draw_text(cell_rect, m_model->column_name(column_index), TextAlignment::CenterLeft, Color::Black); + Rect cell_rect(x_offset, 0, m_model->column_width(column_index) + horizontal_padding, item_height()); + painter.draw_text(cell_rect.translated(horizontal_padding, 0), m_model->column_name(column_index), TextAlignment::CenterLeft, Color::Black); x_offset += m_model->column_width(column_index) + horizontal_padding; + painter.draw_line(cell_rect.top_left(), cell_rect.bottom_left(), Color::White); + painter.draw_line(cell_rect.top_right(), cell_rect.bottom_right(), Color::DarkGray); } painter.draw_line({ 0, 0 }, { width() - 1, 0 }, Color::White); painter.draw_line({ 0, header_height() - 1 }, { width() - 1, header_height() - 1 }, Color::DarkGray); |