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

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

View File

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

View File

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