mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 19:07:35 +00:00
LibGUI: Add GTableModel::Role::ForegroundColor.
This makes it possible to specify the text color for each table cell. Use this to make the IRCClient show unread window list items in red.
This commit is contained in:
parent
f4b8e4966f
commit
d466f2634d
10 changed files with 120 additions and 63 deletions
|
@ -39,12 +39,14 @@ GTableModel::ColumnMetadata IRCChannelMemberListModel::column_metadata(int colum
|
|||
ASSERT_NOT_REACHED();
|
||||
}
|
||||
|
||||
GVariant IRCChannelMemberListModel::data(const GModelIndex& index, Role) const
|
||||
GVariant IRCChannelMemberListModel::data(const GModelIndex& index, Role role) const
|
||||
{
|
||||
switch (index.column()) {
|
||||
case Column::Name: return m_channel.member_at(index.row());
|
||||
if (role == Role::Display) {
|
||||
switch (index.column()) {
|
||||
case Column::Name: return m_channel.member_at(index.row());
|
||||
}
|
||||
}
|
||||
ASSERT_NOT_REACHED();
|
||||
return { };
|
||||
}
|
||||
|
||||
void IRCChannelMemberListModel::update()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue