mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 09:38:11 +00:00
IRCClient: Switch to using an HtmlView for the IRC window contents :^)
This seemed like a perfect fit for LibHTML. We can now style the IRC channels and queries however we like with the power of HTML and CSS. This patch doesn't do much in the way of styling, it just gets the basic mechanism into place.
This commit is contained in:
parent
98ff8ef0cf
commit
fa69b9fbb7
8 changed files with 64 additions and 146 deletions
|
@ -1,12 +1,10 @@
|
|||
#pragma once
|
||||
|
||||
#include <AK/String.h>
|
||||
#include <AK/CircularQueue.h>
|
||||
#include <AK/RefPtr.h>
|
||||
#include <AK/RefCounted.h>
|
||||
#include <AK/RefPtr.h>
|
||||
#include <AK/String.h>
|
||||
#include <LibDraw/Color.h>
|
||||
|
||||
class IRCLogBufferModel;
|
||||
#include <LibHTML/DOM/Document.h>
|
||||
|
||||
class IRCLogBuffer : public RefCounted<IRCLogBuffer> {
|
||||
public:
|
||||
|
@ -21,17 +19,15 @@ public:
|
|||
Color color { Color::Black };
|
||||
};
|
||||
|
||||
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, Color = Color::Black);
|
||||
void add_message(const String& text, Color = Color::Black);
|
||||
void dump() const;
|
||||
|
||||
const IRCLogBufferModel* model() const { return m_model.ptr(); }
|
||||
IRCLogBufferModel* model() { return m_model.ptr(); }
|
||||
const Document& document() const { return *m_document; }
|
||||
Document& document() { return *m_document; }
|
||||
|
||||
private:
|
||||
IRCLogBuffer();
|
||||
NonnullRefPtr<IRCLogBufferModel> m_model;
|
||||
CircularQueue<Message, 1000> m_messages;
|
||||
RefPtr<Document> m_document;
|
||||
RefPtr<Element> m_container_element;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue