mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 23:37:35 +00:00
GTableView: Add a way to turn off alternating row colors.
This commit is contained in:
parent
491aa112ab
commit
b54ab06595
5 changed files with 15 additions and 7 deletions
|
@ -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 });
|
||||
|
|
|
@ -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()));
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue