mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 21:07:35 +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
|
@ -61,3 +61,29 @@ void IRCWindow::set_log_buffer(const IRCLogBuffer& log_buffer)
|
|||
m_log_buffer = &log_buffer;
|
||||
m_table_view->set_model(OwnPtr<IRCLogBufferModel>((IRCLogBufferModel*)log_buffer.model()));
|
||||
}
|
||||
|
||||
bool IRCWindow::is_active() const
|
||||
{
|
||||
return m_client.current_window() == this;
|
||||
}
|
||||
|
||||
void IRCWindow::did_add_message()
|
||||
{
|
||||
if (!is_active()) {
|
||||
++m_unread_count;
|
||||
m_client.aid_update_window_list();
|
||||
}
|
||||
}
|
||||
|
||||
void IRCWindow::clear_unread_count()
|
||||
{
|
||||
if (!m_unread_count)
|
||||
return;
|
||||
m_unread_count = 0;
|
||||
m_client.aid_update_window_list();
|
||||
}
|
||||
|
||||
int IRCWindow::unread_count() const
|
||||
{
|
||||
return m_unread_count;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue