diff options
-rw-r--r-- | Applications/IRCClient/IRCAppWindow.cpp | 1 | ||||
-rw-r--r-- | Applications/IRCClient/IRCClientWindow.cpp | 4 | ||||
-rw-r--r-- | Applications/IRCClient/IRCLogBuffer.h | 4 | ||||
-rw-r--r-- | LibGUI/GTableView.cpp | 9 | ||||
-rw-r--r-- | LibGUI/GTableView.h | 4 |
5 files changed, 15 insertions, 7 deletions
diff --git a/Applications/IRCClient/IRCAppWindow.cpp b/Applications/IRCClient/IRCAppWindow.cpp index 308516801d..c026bd074f 100644 --- a/Applications/IRCClient/IRCAppWindow.cpp +++ b/Applications/IRCClient/IRCAppWindow.cpp @@ -49,6 +49,7 @@ void IRCAppWindow::setup_widgets() auto* window_list = new GTableView(widget); window_list->set_headers_visible(false); + window_list->set_alternating_row_colors(false); window_list->set_model(OwnPtr<IRCClientWindowListModel>(m_client.client_window_list_model())); window_list->set_size_policy(SizePolicy::Fixed, SizePolicy::Fill); window_list->set_preferred_size({ 120, 0 }); diff --git a/Applications/IRCClient/IRCClientWindow.cpp b/Applications/IRCClient/IRCClientWindow.cpp index d2d35630fe..32dfb2c2bb 100644 --- a/Applications/IRCClient/IRCClientWindow.cpp +++ b/Applications/IRCClient/IRCClientWindow.cpp @@ -16,19 +16,21 @@ IRCClientWindow::IRCClientWindow(IRCClient& client, Type type, const String& nam { set_layout(make<GBoxLayout>(Orientation::Vertical)); - // Make a container for the log buffer view + optional member list. + // Make a container for the log buffer view + (optional) member list. GWidget* container = new GWidget(this); container->set_layout(make<GBoxLayout>(Orientation::Horizontal)); m_table_view = new GTableView(container); m_table_view->set_headers_visible(false); m_table_view->set_font(Font::default_fixed_width_font()); + m_table_view->set_alternating_row_colors(false); if (m_type == Channel) { auto* member_view = new GTableView(container); member_view->set_headers_visible(false); member_view->set_size_policy(SizePolicy::Fixed, SizePolicy::Fill); member_view->set_preferred_size({ 100, 0 }); + member_view->set_alternating_row_colors(false); member_view->set_model(OwnPtr<IRCChannelMemberListModel>(m_client.ensure_channel(m_name).member_model())); } diff --git a/Applications/IRCClient/IRCLogBuffer.h b/Applications/IRCClient/IRCLogBuffer.h index 7cfb6531af..979feaaf30 100644 --- a/Applications/IRCClient/IRCLogBuffer.h +++ b/Applications/IRCClient/IRCLogBuffer.h @@ -21,9 +21,7 @@ public: int count() const { return m_messages.size(); } const Message& at(int index) const { return m_messages.at(index); } - void add_message(char prefix, const String& name, const String& text); - void dump() const; const IRCLogBufferModel* model() const { return m_model; } @@ -31,8 +29,6 @@ public: private: IRCLogBuffer(); - IRCLogBufferModel* m_model { nullptr }; - CircularQueue<Message, 1000> m_messages; }; diff --git a/LibGUI/GTableView.cpp b/LibGUI/GTableView.cpp index d5212bed0f..d673fdccbf 100644 --- a/LibGUI/GTableView.cpp +++ b/LibGUI/GTableView.cpp @@ -157,8 +157,13 @@ void GTableView::paint_event(GPaintEvent& event) key_column_background_color = is_focused() ? Color::from_rgb(0x84351a) : Color::from_rgb(0x606060); text_color = Color::White; } else { - background_color = painted_item_index % 2 ? Color(210, 210, 210) : Color::White; - key_column_background_color = painted_item_index % 2 ? Color(190, 190, 190) : Color(235, 235, 235); + if (alternating_row_colors() && (painted_item_index % 2)) { + background_color = Color(210, 210, 210); + key_column_background_color = Color(190, 190, 190); + } else { + background_color = Color::White; + key_column_background_color = Color(235, 235, 235); + } text_color = Color::Black; } diff --git a/LibGUI/GTableView.h b/LibGUI/GTableView.h index bfed3121a0..2bdc179e76 100644 --- a/LibGUI/GTableView.h +++ b/LibGUI/GTableView.h @@ -23,6 +23,9 @@ public: bool headers_visible() const { return m_headers_visible; } void set_headers_visible(bool headers_visible) { m_headers_visible = headers_visible; } + bool alternating_row_colors() const { return m_alternating_row_colors; } + void set_alternating_row_colors(bool b) { m_alternating_row_colors = b; } + void did_update_model(); int content_width() const; @@ -54,4 +57,5 @@ private: OwnPtr<GTableModel> m_model; int m_horizontal_padding { 5 }; bool m_headers_visible { true }; + bool m_alternating_row_colors { true }; }; |