mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 03:27:44 +00:00
IRCClient: Add a little "(n)" indicator to window list for unread messages.
This commit is contained in:
parent
1394677528
commit
b4f787090c
9 changed files with 68 additions and 14 deletions
|
@ -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();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue