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:
Andreas Kling 2019-03-18 04:54:07 +01:00
commit d466f2634d
Notes: sideshowbarker 2024-07-19 15:01:03 +09:00
10 changed files with 120 additions and 63 deletions

View file

@ -120,7 +120,7 @@ void IRCAppWindow::setup_widgets()
m_window_list->set_alternating_row_colors(false);
m_window_list->set_model(OwnPtr<IRCWindowListModel>(m_client.client_window_list_model()));
m_window_list->set_size_policy(SizePolicy::Fixed, SizePolicy::Fill);
m_window_list->set_preferred_size({ 120, 0 });
m_window_list->set_preferred_size({ 100, 0 });
m_client.client_window_list_model()->on_activation = [this] (IRCWindow& window) {
m_container->set_active_widget(&window);
window.clear_unread_count();