mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 17:52:45 +00:00 
			
		
		
		
	IRCClient: Refactor window creation responsibilities.
IRCChannel and IRCQuery objects now create their own windows with the help of an aid_create_window callback provided by IRCAppWindow. There's still a bit of murk but this is already an improvement.
This commit is contained in:
		
							parent
							
								
									fc7f700c20
								
							
						
					
					
						commit
						1394677528
					
				
					 10 changed files with 40 additions and 48 deletions
				
			
		|  | @ -8,9 +8,10 @@ | |||
| #include <LibGUI/GTextEditor.h> | ||||
| #include <LibGUI/GTextBox.h> | ||||
| 
 | ||||
| IRCWindow::IRCWindow(IRCClient& client, Type type, const String& name, GWidget* parent) | ||||
| IRCWindow::IRCWindow(IRCClient& client, void* owner, Type type, const String& name, GWidget* parent) | ||||
|     : GWidget(parent) | ||||
|     , m_client(client) | ||||
|     , m_owner(owner) | ||||
|     , m_type(type) | ||||
|     , m_name(name) | ||||
| { | ||||
|  | @ -31,7 +32,7 @@ IRCWindow::IRCWindow(IRCClient& client, Type type, const String& name, GWidget* | |||
|         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())); | ||||
|         member_view->set_model(OwnPtr<IRCChannelMemberListModel>(channel().member_model())); | ||||
|     } | ||||
| 
 | ||||
|     m_text_editor = new GTextEditor(GTextEditor::SingleLine, this); | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Andreas Kling
						Andreas Kling