From b82c5835ce34affab3c1533320d7a5196b301019 Mon Sep 17 00:00:00 2001 From: krepa098 Date: Tue, 6 Jan 2015 14:30:24 +0100 Subject: [PATCH] error symbol --- res.qrc | 1 + src/chatlog/chatmessage.cpp | 11 +- src/chatlog/content/image.cpp | 2 +- ui/chatArea/error.png | Bin 0 -> 765 bytes ui/chatArea/symbols.svg | 188 ++++++++++++++++++++++------------ 5 files changed, 132 insertions(+), 70 deletions(-) create mode 100644 ui/chatArea/error.png diff --git a/res.qrc b/res.qrc index 18c61ce88..0b461bf8e 100644 --- a/res.qrc +++ b/res.qrc @@ -150,6 +150,7 @@ ui/chatArea/innerStyle.css ui/chatArea/spinner.png ui/chatArea/info.png + ui/chatArea/error.png ui/chatArea/scrollBarDownArrow.png ui/chatArea/scrollBarDownArrowHover.png ui/chatArea/scrollBarDownArrowPressed.png diff --git a/src/chatlog/chatmessage.cpp b/src/chatlog/chatmessage.cpp index 0f0f54a61..687c02803 100644 --- a/src/chatlog/chatmessage.cpp +++ b/src/chatlog/chatmessage.cpp @@ -68,12 +68,17 @@ ChatMessage::Ptr ChatMessage::createChatInfoMessage(const QString &rawMessage, S { ChatMessage::Ptr msg = ChatMessage::Ptr(new ChatMessage); - msg->addColumn(new Image(QSizeF(16, 16), ":/ui/chatArea/info.png"), ColumnFormat(NAME_COL_WIDTH, ColumnFormat::FixedSize, ColumnFormat::Right)); + QString img; + switch(type) + { + case INFO: img = ":/ui/chatArea/info.png"; break; + case ERROR: img = ":/ui/chatArea/error.png"; break; + } + + msg->addColumn(new Image(QSizeF(16, 16), img), ColumnFormat(NAME_COL_WIDTH, ColumnFormat::FixedSize, ColumnFormat::Right)); msg->addColumn(new Text(rawMessage, Style::getFont(Style::Big), false, rawMessage), ColumnFormat(1.0, ColumnFormat::VariableSize)); msg->addColumn(new Text(date.toString(Settings::getInstance().getTimestampFormat()), Style::getFont(Style::Big)), ColumnFormat(TIME_COL_WIDTH, ColumnFormat::FixedSize, ColumnFormat::Right)); - Q_UNUSED(type) - return msg; } diff --git a/src/chatlog/content/image.cpp b/src/chatlog/content/image.cpp index 768a3418b..bbea866a7 100644 --- a/src/chatlog/content/image.cpp +++ b/src/chatlog/content/image.cpp @@ -41,8 +41,8 @@ qreal Image::getAscent() const void Image::paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget) { - painter->translate(-size.width() / 2.0, -size.height() / 2.0); painter->setRenderHint(QPainter::SmoothPixmapTransform); + painter->translate(-size.width() / 2.0, -size.height() / 2.0); painter->drawPixmap(0, 0, size.width(), size.height(), pmap); Q_UNUSED(option) diff --git a/ui/chatArea/error.png b/ui/chatArea/error.png new file mode 100644 index 0000000000000000000000000000000000000000..06686cd6cfc5de2f50d81aea41d1b75bd8c5aa4e GIT binary patch literal 765 zcmVK`OOB;V@#G=bSdav)y?8J-yZd_Cgs8FEjhghq9(HHG`MqUk zzWIidkVqttve_y6z6;5XzBOcRW2I0yL&5Dr*Q51@4F zI0sw#eDGichnb8==_AO6zD~O(RYmTsmP+M;3>KKStd+Y`G!dg5t1_WS9OpcGoilel4n8|ou@4{X#mwMG~o+RFCgG#FYbeyHFd_FJ$ zFx_mf4-F0gB+Hams;bNd|yNe{34x7+E_q1G2VZRtkkP0HZL`SSb|F3?xNm)KEof zAClUOurzD~ZKeT$Q^z@g)H}UBg{11K;~aDhY~}NT$ep3_$(?q^+{pv0rBYdBWeD&} zccpwI5sii6Hh|g_@@o;JqX!kGp@hpIfFz6=gXjNF&HangTPB85miIgh-V}=`R$6|H vH6gNMrR835;D5fFb!()T)4LImdp-XP`?O-fisap<00000NkvXXu0mjfRMJ^w literal 0 HcmV?d00001 diff --git a/ui/chatArea/symbols.svg b/ui/chatArea/symbols.svg index 45f26aec3..6d7e04692 100644 --- a/ui/chatArea/symbols.svg +++ b/ui/chatArea/symbols.svg @@ -7,10 +7,34 @@ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" version="1.2" width="744.09448" height="1052.3622" - id="svg2"> + id="svg2" + inkscape:version="0.48.5 r10040" + sodipodi:docname="symbols.svg"> + - - - ! - - - i - - - i - + id="g3864" + transform="translate(-19.999993,-14.285714)"> + + ! + + + i + + + i + + + i