mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 04:09:13 +00:00
Spreadsheet: Add (limited) support for custom cell formatting
This commit is contained in:
parent
e75247a75b
commit
054638c355
Notes:
sideshowbarker
2024-07-19 03:02:55 +09:00
Author: https://github.com/alimpfard
Commit: 054638c355
Pull-request: https://github.com/SerenityOS/serenity/pull/3338
10 changed files with 466 additions and 4 deletions
|
@ -67,8 +67,13 @@ GUI::Variant SheetModel::data(const GUI::ModelIndex& index, GUI::ModelRole role)
|
|||
return cell->typed_display();
|
||||
}
|
||||
|
||||
if (role == GUI::ModelRole::TextAlignment)
|
||||
return {};
|
||||
if (role == GUI::ModelRole::TextAlignment) {
|
||||
const auto* cell = m_sheet->at({ m_sheet->column(index.column()), (size_t)index.row() });
|
||||
if (!cell)
|
||||
return {};
|
||||
|
||||
return cell->type_metadata().alignment;
|
||||
}
|
||||
|
||||
if (role == GUI::ModelRole::ForegroundColor) {
|
||||
const auto* cell = m_sheet->at({ m_sheet->column(index.column()), (size_t)index.row() });
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue