diff options
author | Andreas Kling <awesomekling@gmail.com> | 2019-02-28 11:31:07 +0100 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-02-28 11:31:07 +0100 |
commit | fd280a6a03d90941f8a2587f16c4b42af566fdb5 (patch) | |
tree | 7c8534c904cad46c4a4311771856d8f9b58ad2ff | |
parent | b4c20789fb82639b5bc679cc17af90a65f721aeb (diff) | |
download | serenity-fd280a6a03d90941f8a2587f16c4b42af566fdb5.zip |
LibGUI: Pad GTableView cells on the right side as well.
-rw-r--r-- | LibGUI/GTableView.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/LibGUI/GTableView.cpp b/LibGUI/GTableView.cpp index 6d236ac9e1..66047c9801 100644 --- a/LibGUI/GTableView.cpp +++ b/LibGUI/GTableView.cpp @@ -91,7 +91,7 @@ void GTableView::paint_event(GPaintEvent&) int column_width = column_metadata.preferred_width; Rect cell_rect(horizontal_padding + x_offset, y, column_width, item_height()); painter.draw_text(cell_rect, m_model->data(row_index, column_index), column_metadata.text_alignment, text_color); - x_offset += column_width + horizontal_padding; + x_offset += column_width + horizontal_padding * 2; } ++painted_item_index; }; @@ -107,9 +107,9 @@ void GTableView::paint_event(GPaintEvent&) for (int column_index = 0; column_index < m_model->column_count(); ++column_index) { auto column_metadata = m_model->column_metadata(column_index); int column_width = column_metadata.preferred_width; - Rect cell_rect(x_offset, 0, column_width + horizontal_padding, item_height()); + Rect cell_rect(x_offset, 0, column_width + horizontal_padding * 2, item_height()); painter.draw_text(cell_rect.translated(horizontal_padding, 0), m_model->column_name(column_index), TextAlignment::CenterLeft, Color::Black); - x_offset += column_width + horizontal_padding; + x_offset += column_width + horizontal_padding * 2; 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); } |