From dc53c90d6e17917ce4da22163863f6b8d592eb2b Mon Sep 17 00:00:00 2001 From: Charles Dang Date: Wed, 23 Mar 2016 13:14:00 +1100 Subject: [PATCH] tlobby_main: enable markup in chat log --- src/gui/dialogs/lobby/lobby.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/gui/dialogs/lobby/lobby.cpp b/src/gui/dialogs/lobby/lobby.cpp index f1bccae13e4d..754b04e1bcf4 100644 --- a/src/gui/dialogs/lobby/lobby.cpp +++ b/src/gui/dialogs/lobby/lobby.cpp @@ -204,7 +204,7 @@ void tlobby_main::add_chat_message(const time_t& /*time*/, events::chat_handler::MESSAGE_TYPE /*type*/) { std::stringstream ss; - ss << "<" << speaker << "> "; + ss << "<" << speaker << "> "; ss << message; append_to_chatbox(ss.str()); } @@ -311,6 +311,7 @@ void tlobby_main::append_to_chatbox(const std::string& text, size_t id) { tgrid& grid = chat_log_container_->page_grid(id); tscroll_label& log = find_widget(&grid, "log_text", false); + log.set_use_markup(true); log.set_label(log.label() + "\n" + preferences::get_chat_timestamp(time(0)) + text); log.scroll_vertical_scrollbar(tscrollbar_::END); @@ -1163,7 +1164,7 @@ void tlobby_main::add_whisper_window_whisper(const std::string& sender, const std::string& message) { std::stringstream ss; - ss << "<" << sender << ">" << message; + ss << "<" << sender << "> " << message; tlobby_chat_window* t = whisper_window_open(sender, false); if(!t) { ERR_LB << "Whisper window not open in add_whisper_window_whisper for " @@ -1177,8 +1178,8 @@ void tlobby_main::add_active_window_whisper(const std::string& sender, const std::string& message) { std::stringstream ss; - ss << "<" - << "whisper: " << sender << ">" << message; + ss << "<" + << "whisper: " << sender << "> " << message; append_to_chatbox(ss.str()); } @@ -1187,7 +1188,7 @@ void tlobby_main::add_room_window_message(const std::string& room, const std::string& message) { std::stringstream ss; - ss << "<" << sender << ">" << message; + ss << "<" << sender << "> " << message; tlobby_chat_window* t = room_window_open(room, false); if(!t) { ERR_LB << "Room window not open in add_room_window_message for " << room @@ -1201,7 +1202,7 @@ void tlobby_main::add_active_window_message(const std::string& sender, const std::string& message) { std::stringstream ss; - ss << "<" << sender << ">" << message; + ss << "<" << sender << "> " << message; append_to_chatbox(ss.str()); }