1
0
Fork 0
mirror of https://github.com/LadybirdBrowser/ladybird.git synced 2025-06-11 18:20:43 +09:00

Mail: Make Date the first column

This commit is contained in:
Karol Kosek 2023-08-29 15:54:19 +02:00 committed by Andrew Kaster
parent 392fcc0ce6
commit 59968c97f0
Notes: sideshowbarker 2024-07-17 04:03:27 +09:00
3 changed files with 7 additions and 7 deletions

View file

@ -27,12 +27,12 @@ int InboxModel::row_count(GUI::ModelIndex const&) const
ErrorOr<String> InboxModel::column_name(int column_index) const
{
switch (column_index) {
case Date:
return "Date"_string;
case Column::From:
return "From"_string;
case Subject:
return "Subject"_string;
case Date:
return "Date"_string;
default:
VERIFY_NOT_REACHED();
}
@ -42,12 +42,12 @@ GUI::Variant InboxModel::data(GUI::ModelIndex const& index, GUI::ModelRole role)
{
auto& value = m_entries[index.row()];
if (role == GUI::ModelRole::Display) {
if (index.column() == Column::Date)
return value.date;
if (index.column() == Column::From)
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)

View file

@ -12,9 +12,9 @@
struct InboxEntry {
u32 sequence_number;
DeprecatedString date;
DeprecatedString from;
DeprecatedString subject;
DeprecatedString date;
bool seen;
};
@ -26,9 +26,9 @@ enum class InboxModelCustomRole {
class InboxModel final : public GUI::Model {
public:
enum Column {
Date,
From,
Subject,
Date,
__Count
};

View file

@ -407,7 +407,7 @@ void MailWidget::selected_mailbox()
if (from.is_empty())
from = "(Unknown sender)";
InboxEntry inbox_entry { sequence_number, from, subject, date, seen };
InboxEntry inbox_entry { sequence_number, date, from, subject, seen };
m_statusbar->set_text(String::formatted("[{}]: Loading entry {}", mailbox.name, ++i).release_value_but_fixme_should_propagate_errors());
active_inbox_entries.append(inbox_entry);