mirror of
https://github.com/celisej567/abaddon.git
synced 2026-09-19 20:11:59 +03:00
rework chat components to make more sense
This commit is contained in:
@@ -7,7 +7,23 @@ enum class ChatDisplayType {
|
||||
Text,
|
||||
};
|
||||
|
||||
class ChatMessageItem : public Gtk::ListBoxRow {
|
||||
// contains the username and timestamp, chat items get stuck into its box
|
||||
class ChatMessageContainer : public Gtk::ListBoxRow {
|
||||
public:
|
||||
Snowflake UserID;
|
||||
|
||||
ChatMessageContainer(const MessageData *data);
|
||||
void AddNewContent(Gtk::Widget *widget, bool prepend = false);
|
||||
|
||||
protected:
|
||||
Gtk::Box *m_main_box;
|
||||
Gtk::Box *m_content_box;
|
||||
Gtk::Box *m_meta_box;
|
||||
Gtk::Label *m_author;
|
||||
Gtk::Label *m_timestamp;
|
||||
};
|
||||
|
||||
class ChatMessageItem {
|
||||
public:
|
||||
Snowflake ID;
|
||||
ChatDisplayType MessageType;
|
||||
@@ -15,18 +31,10 @@ public:
|
||||
virtual void MarkAsDeleted() = 0;
|
||||
};
|
||||
|
||||
class ChatMessageTextItem : public ChatMessageItem {
|
||||
class ChatMessageTextItem
|
||||
: public Gtk::TextView // oh well
|
||||
, public ChatMessageItem {
|
||||
public:
|
||||
ChatMessageTextItem(const MessageData *data);
|
||||
void AppendNewContent(std::string content);
|
||||
void PrependNewContent(std::string content);
|
||||
virtual void MarkAsDeleted();
|
||||
|
||||
protected:
|
||||
Gtk::Box *m_main_box;
|
||||
Gtk::Box *m_sub_box;
|
||||
Gtk::Box *m_meta_box;
|
||||
Gtk::Label *m_author;
|
||||
Gtk::Label *m_timestamp;
|
||||
Gtk::TextView *m_text;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user