From e69da57ec9eb2961cd90b13551eb39c97397f19a Mon Sep 17 00:00:00 2001 From: defnax Date: Fri, 28 Mar 2008 14:53:33 +0000 Subject: [PATCH] Added for Timestamp own color git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@431 b45a01b8-16f6-495d-af2f-9b41ad6348cc --- .../src/gui/chat/PopupChatDialog.cpp | 28 ++++++++++--------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/retroshare-gui/src/gui/chat/PopupChatDialog.cpp b/retroshare-gui/src/gui/chat/PopupChatDialog.cpp index 647869c02..ae053ba32 100644 --- a/retroshare-gui/src/gui/chat/PopupChatDialog.cpp +++ b/retroshare-gui/src/gui/chat/PopupChatDialog.cpp @@ -173,11 +173,11 @@ void PopupChatDialog::addChatMsg(ChatInfo *ci) QString timestamp = "[" + QDateTime::currentDateTime().toString("hh:mm:ss") + "]"; //QString pre = tr("Peer:" ); - QString name = QString::fromStdString(ci->name); - QString line = "" + timestamp + - " " + name + ""; - - extraTxt += line; + QString name = QString::fromStdString(ci->name); + QString line = "" + timestamp + "" + + "" + " " + name + ""; + + extraTxt += line; extraTxt += QString::fromStdWString(ci -> msg); @@ -244,14 +244,16 @@ void PopupChatDialog::showAvatarFrame(bool show) void PopupChatDialog::setColor() { + QColor col = QColorDialog::getColor(Qt::black, this); if (col.isValid()) { - ui.colorButton->setPalette(QPalette(col)); + //ui.colorButton->setPalette(QPalette(col)); + //ui.chattextEdit->setTextCursor(); ui.chattextEdit->setTextColor(QColor(col)); - QTextCharFormat fmt; - fmt.setForeground(col); - mergeFormatOnWordOrSelection(fmt); + //QTextCharFormat fmt; + //fmt.setForeground(col); + //mergeFormatOnWordOrSelection(fmt); colorChanged(col); } } @@ -265,11 +267,11 @@ void PopupChatDialog::colorChanged(const QColor &c) void PopupChatDialog::mergeFormatOnWordOrSelection(const QTextCharFormat &format) { - QTextCursor cursor = ui.chattextEdit->textCursor(); - if (!cursor.hasSelection()) + //QTextCursor cursor = ui.chattextEdit->textCursor(); + /*if (!cursor.hasSelection()) cursor.select(QTextCursor::WordUnderCursor); - cursor.mergeCharFormat(format); - ui.chattextEdit->mergeCurrentCharFormat(format); + cursor.mergeCharFormat(format);*/ + //ui.chattextEdit->mergeCurrentCharFormat(format); } void PopupChatDialog::getFont()