diff options
author | Andreas Kling <awesomekling@gmail.com> | 2019-03-18 04:54:07 +0100 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-03-18 04:54:07 +0100 |
commit | d466f2634d94df44402c5779395a8f3798151d45 (patch) | |
tree | c7624d7de825913772aba6f8d304f19901459cb1 /Applications/FileManager | |
parent | f4b8e4966ffa07f250e4952060791b1606aa10f2 (diff) | |
download | serenity-d466f2634d94df44402c5779395a8f3798151d45.zip |
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.
Diffstat (limited to 'Applications/FileManager')
-rw-r--r-- | Applications/FileManager/DirectoryTableModel.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/Applications/FileManager/DirectoryTableModel.cpp b/Applications/FileManager/DirectoryTableModel.cpp index e04b544098..a1a0967eab 100644 --- a/Applications/FileManager/DirectoryTableModel.cpp +++ b/Applications/FileManager/DirectoryTableModel.cpp @@ -151,18 +151,18 @@ GVariant DirectoryTableModel::data(const GModelIndex& index, Role role) const } ASSERT_NOT_REACHED(); } - ASSERT(role == Role::Display); - switch (index.column()) { - case Column::Icon: return icon_for(entry); - case Column::Name: return entry.name; - case Column::Size: return (int)entry.size; - case Column::Owner: return name_for_uid(entry.uid); - case Column::Group: return name_for_gid(entry.gid); - case Column::Permissions: return permission_string(entry.mode); - case Column::Inode: return (int)entry.inode; + if (role == Role::Display) { + switch (index.column()) { + case Column::Icon: return icon_for(entry); + case Column::Name: return entry.name; + case Column::Size: return (int)entry.size; + case Column::Owner: return name_for_uid(entry.uid); + case Column::Group: return name_for_gid(entry.gid); + case Column::Permissions: return permission_string(entry.mode); + case Column::Inode: return (int)entry.inode; + } } - ASSERT_NOT_REACHED(); - + return { }; } void DirectoryTableModel::update() |