aboutsummaryrefslogtreecommitdiff
path: root/src/ChatMessage.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/ChatMessage.cpp')
-rw-r--r--src/ChatMessage.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/ChatMessage.cpp b/src/ChatMessage.cpp
new file mode 100644
index 0000000..6dbd671
--- /dev/null
+++ b/src/ChatMessage.cpp
@@ -0,0 +1,22 @@
+#include "../include/ChatMessage.hpp"
+
+namespace dchat
+{
+ ChatMessage::ChatMessage(const Glib::ustring &_username, const Glib::ustring &_text) :
+ username(_username),
+ text(_text)
+ {
+ username.set_selectable(true);
+ username.set_alignment(Gtk::ALIGN_START, Gtk::ALIGN_START);
+ username.get_style_context()->add_class("chat-message-username");
+
+ text.set_selectable(true);
+ text.set_alignment(Gtk::ALIGN_START, Gtk::ALIGN_START);
+ text.set_line_wrap_mode(Pango::WRAP_WORD_CHAR);
+ text.get_style_context()->add_class("chat-message-text");
+
+ attach(username, 0, 0, 1, 1);
+ attach(text, 0, 1, 1, 1);
+ get_style_context()->add_class("chat-message");
+ }
+} \ No newline at end of file