1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-28 19:45:10 +00:00

Spreadsheet: Make cells right-aligned by default

Until we have better control over cell content alignment, let's make
them all right-aligned by default since that makes numbers look nice,
and numbers are the bread & butter of spreadsheets. :^)
This commit is contained in:
Andreas Kling 2020-08-29 00:49:15 +02:00
parent c3b3a078f3
commit 87f36b0852

View file

@ -146,7 +146,7 @@ void SpreadsheetView::TableCellPainter::paint(GUI::Painter& painter, const Gfx::
auto text_color = index.data(GUI::ModelRole::ForegroundColor).to_color(palette.color(m_table_view.foreground_role()));
auto data = index.data();
auto text_alignment = index.data(GUI::ModelRole::TextAlignment).to_text_alignment(Gfx::TextAlignment::CenterLeft);
auto text_alignment = index.data(GUI::ModelRole::TextAlignment).to_text_alignment(Gfx::TextAlignment::CenterRight);
painter.draw_text(rect, data.to_string(), m_table_view.font_for_index(index), text_alignment, text_color, Gfx::TextElision::Right);
}