mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 03:37:45 +00:00
GTableView: Add ability to hide individual columns at view-level.
Use this in IRCClient to hide the "sender" column in the server message view since everything in that view comes from the "Server" anyway.
This commit is contained in:
parent
d17a91f185
commit
951377e93e
5 changed files with 41 additions and 3 deletions
|
@ -246,7 +246,7 @@ void IRCClient::handle(const Message& msg, const String&)
|
|||
|
||||
void IRCClient::add_server_message(const String& text)
|
||||
{
|
||||
m_log->add_message(0, "Server", text);
|
||||
m_log->add_message(0, "", text);
|
||||
m_server_subwindow->did_add_message();
|
||||
}
|
||||
|
||||
|
@ -354,7 +354,7 @@ void IRCClient::handle_ping(const Message& msg)
|
|||
{
|
||||
if (msg.arguments.size() < 0)
|
||||
return;
|
||||
m_log->add_message(0, "Server", "Ping? Pong!");
|
||||
m_log->add_message(0, "", "Ping? Pong!");
|
||||
send_pong(msg.arguments[0]);
|
||||
}
|
||||
|
||||
|
|
|
@ -60,6 +60,8 @@ GVariant IRCLogBufferModel::data(const GModelIndex& index, Role role) const
|
|||
}
|
||||
}
|
||||
if (role == Role::ForegroundColor) {
|
||||
if (index.column() == Column::Timestamp)
|
||||
return Color(Color::MidGray);
|
||||
if (index.column() == Column::Text)
|
||||
return m_log_buffer->at(index.row()).color;
|
||||
}
|
||||
|
|
|
@ -26,6 +26,10 @@ IRCWindow::IRCWindow(IRCClient& client, void* owner, Type type, const String& na
|
|||
m_table_view->set_font(Font::default_fixed_width_font());
|
||||
m_table_view->set_alternating_row_colors(false);
|
||||
|
||||
if (m_type == Server) {
|
||||
m_table_view->set_column_hidden(IRCLogBufferModel::Column::Name, true);
|
||||
}
|
||||
|
||||
if (m_type == Channel) {
|
||||
auto* member_view = new GTableView(container);
|
||||
member_view->set_headers_visible(false);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue