mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-22 04:25:13 +00:00
LibGUI: Calculate the text rect correctly in AbstractTableView
This fixes the misalignments when a header is not left-aligned.
This commit is contained in:
parent
d0c96ba2d8
commit
09ccb46980
Notes:
sideshowbarker
2024-07-19 03:12:46 +09:00
Author: https://github.com/alimpfard Commit: https://github.com/SerenityOS/serenity/commit/09ccb46980b Pull-request: https://github.com/SerenityOS/serenity/pull/3279 Reviewed-by: https://github.com/awesomekling Reviewed-by: https://github.com/linusg
1 changed files with 1 additions and 1 deletions
|
@ -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());
|
||||
|
|
Loading…
Add table
Reference in a new issue