mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-12-27 00:19:25 -05:00
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:
parent
a0247d39d1
commit
2cb92f2d5a
@ -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)
|
||||||
|
@ -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;
|
||||||
|
@ -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/>
|
||||||
|
Loading…
Reference in New Issue
Block a user