mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 08:36:15 +00:00
IRCClient: Add a little "(n)" indicator to window list for unread messages.
This commit is contained in:
@@ -43,7 +43,12 @@ GTableModel::ColumnMetadata IRCWindowListModel::column_metadata(int column) cons
|
||||
GVariant IRCWindowListModel::data(const GModelIndex& index, Role) const
|
||||
{
|
||||
switch (index.column()) {
|
||||
case Column::Name: return m_client.window_at(index.row()).name();
|
||||
case Column::Name: {
|
||||
auto& window = m_client.window_at(index.row());
|
||||
if (!window.unread_count())
|
||||
return window.name();
|
||||
return String::format("%s (%d)\n", window.name().characters(), window.unread_count());
|
||||
}
|
||||
}
|
||||
ASSERT_NOT_REACHED();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user