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:
parent
392fcc0ce6
commit
59968c97f0
Notes:
sideshowbarker
2024-07-17 04:03:27 +09:00
Author: https://github.com/krkk
Commit: 59968c97f0
Pull-request: https://github.com/SerenityOS/serenity/pull/20831
Reviewed-by: https://github.com/ADKaster ✅
3 changed files with 7 additions and 7 deletions
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
};
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue