summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnotherTest <ali.mpfard@gmail.com>2020-08-24 15:15:57 +0430
committerAndreas Kling <kling@serenityos.org>2020-08-24 18:21:33 +0200
commit09ccb46980bb19ec6bf66065914e4ab59aed66e8 (patch)
tree6a1978886ff63ad07d02c6e3d379776583efb06e
parentd0c96ba2d84fdaf1ebbda63581e26feaffa86704 (diff)
downloadserenity-09ccb46980bb19ec6bf66065914e4ab59aed66e8.zip
LibGUI: Calculate the text rect correctly in AbstractTableView
This fixes the misalignments when a header is not left-aligned.
-rw-r--r--Libraries/LibGUI/AbstractTableView.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/Libraries/LibGUI/AbstractTableView.cpp b/Libraries/LibGUI/AbstractTableView.cpp
index bd7aac4f43..ff25d77f89 100644
--- a/Libraries/LibGUI/AbstractTableView.cpp
+++ b/Libraries/LibGUI/AbstractTableView.cpp
@@ -162,7 +162,7 @@ void AbstractTableView::paint_headers(Painter& painter)
} else {
text = model()->column_name(column_index);
}
- auto text_rect = cell_rect.translated(horizontal_padding(), 0);
+ auto text_rect = cell_rect.shrunken(horizontal_padding() * 2, 0);
if (pressed)
text_rect.move_by(1, 1);
painter.draw_text(text_rect, text, header_font(), column_header_alignment(column_index), palette().button_text());