mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 11:48:10 +00:00
IRClient: Add a member list to channel views.
This commit is contained in:
parent
08c15be0ca
commit
491aa112ab
7 changed files with 115 additions and 3 deletions
|
@ -1,5 +1,7 @@
|
|||
#include "IRCClientWindow.h"
|
||||
#include "IRCClient.h"
|
||||
#include "IRCChannel.h"
|
||||
#include "IRCChannelMemberListModel.h"
|
||||
#include "IRCLogBufferModel.h"
|
||||
#include <LibGUI/GBoxLayout.h>
|
||||
#include <LibGUI/GTableView.h>
|
||||
|
@ -13,10 +15,23 @@ IRCClientWindow::IRCClientWindow(IRCClient& client, Type type, const String& nam
|
|||
, m_name(name)
|
||||
{
|
||||
set_layout(make<GBoxLayout>(Orientation::Vertical));
|
||||
m_table_view = new GTableView(this);
|
||||
|
||||
// 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());
|
||||
|
||||
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_model(OwnPtr<IRCChannelMemberListModel>(m_client.ensure_channel(m_name).member_model()));
|
||||
}
|
||||
|
||||
m_text_editor = new GTextEditor(GTextEditor::SingleLine, this);
|
||||
m_text_editor->set_size_policy(SizePolicy::Fill, SizePolicy::Fixed);
|
||||
m_text_editor->set_preferred_size({ 0, 18 });
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue