mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-05 06:32:30 +02:00
LibGUI: Make all views use CenterLeft as the default text alignment
If a model doesn't specify a text alignment for a given field, we now fall back to CenterLeft. This will look better than Center in the vast majority of cases.
This commit is contained in:
Notes:
sideshowbarker
2024-07-19 06:16:35 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/278b3077130
@@ -135,7 +135,7 @@ void TableView::paint_event(PaintEvent& event)
|
||||
if (cell_background_color.is_valid())
|
||||
painter.fill_rect(cell_rect_for_fill, cell_background_color.to_color(background_color));
|
||||
}
|
||||
auto text_alignment = model()->data(cell_index, Model::Role::TextAlignment).to_text_alignment(Gfx::TextAlignment::Center);
|
||||
auto text_alignment = model()->data(cell_index, Model::Role::TextAlignment).to_text_alignment(Gfx::TextAlignment::CenterLeft);
|
||||
painter.draw_text(cell_rect, data.to_string(), font_for_index(cell_index), text_alignment, text_color, Gfx::TextElision::Right);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user