1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 22:48:11 +00:00

Mail: Fetch and display date in e-mail list

Added a third column to show date of e-mail, as sent from the IMAP
server.
This commit is contained in:
Valtteri Koskivuori 2023-07-25 23:32:24 +03:00 committed by Andrew Kaster
parent f74380eecf
commit fc54bd03f9
3 changed files with 33 additions and 3 deletions

View file

@ -24,6 +24,8 @@ ErrorOr<String> InboxModel::column_name(int column_index) const
return "From"_string;
case Subject:
return "Subject"_string;
case Date:
return "Date"_string;
default:
VERIFY_NOT_REACHED();
}
@ -37,6 +39,12 @@ GUI::Variant InboxModel::data(GUI::ModelIndex const& index, GUI::ModelRole role)
return value.from;
if (index.column() == Column::Subject)
return value.subject;
if (index.column() == Column::Date)
return value.date;
}
if (role == GUI::ModelRole::TextAlignment) {
if (index.column() == Column::Date)
return Gfx::TextAlignment::CenterRight;
}
return {};
}