fixed setColor function

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@454 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
defnax 2008-03-31 21:35:29 +00:00
parent a0247d39d1
commit 2cb92f2d5a
3 changed files with 10 additions and 12 deletions

View File

@ -284,18 +284,15 @@ void PopupChatDialog::showAvatarFrame(bool show)
void PopupChatDialog::setColor() void PopupChatDialog::setColor()
{ {
bool ok;
QRgb color = QColorDialog::getRgba(ui.chattextEdit->textColor().rgba(), &ok, this);
if (ok) {
QColor col = QColorDialog::getColor(Qt::black, this); currentColor = QColor(color);
if (col.isValid()) { ui.chattextEdit->setTextColor(currentColor);
colorChanged(currentColor);
//ui.colorButton->setPalette(QPalette(col));
//ui.chattextEdit->setTextCursor();
ui.chattextEdit->setTextColor(QColor(col));
//QTextCharFormat fmt;
//fmt.setForeground(col);
//mergeFormatOnWordOrSelection(fmt);
colorChanged(col);
} }
ui.chattextEdit->setFocus();
} }
void PopupChatDialog::colorChanged(const QColor &c) void PopupChatDialog::colorChanged(const QColor &c)

View File

@ -92,6 +92,7 @@ private:
std::string lastChatName; std::string lastChatName;
QHash<QString, QString> smileys; QHash<QString, QString> smileys;
QColor currentColor;
/** Qt Designer generated object */ /** Qt Designer generated object */
Ui::PopupChatDialog ui; Ui::PopupChatDialog ui;

View File

@ -182,7 +182,7 @@
</size> </size>
</property> </property>
<property name="toolTip" > <property name="toolTip" >
<string>Italic</string> <string>Set Font</string>
</property> </property>
<property name="text" > <property name="text" >
<string/> <string/>