mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
Merge pull request #1208 from PhenomRetroShare/Fix_ChangeChatTextColorWhenChangeStyle
Fix ChatWidget current text edit color when changing appearance style.
This commit is contained in:
commit
c7549a260a
@ -474,6 +474,7 @@ uint32_t ChatWidget::maxMessageSize()
|
||||
|
||||
bool ChatWidget::eventFilter(QObject *obj, QEvent *event)
|
||||
{
|
||||
//QEvent::Type type = event->type();
|
||||
if (obj == ui->textBrowser || obj == ui->textBrowser->viewport()
|
||||
|| obj == ui->leSearch || obj == ui->chatTextEdit) {
|
||||
if (event->type() == QEvent::KeyPress) {
|
||||
@ -673,6 +674,17 @@ bool ChatWidget::eventFilter(QObject *obj, QEvent *event)
|
||||
}
|
||||
}
|
||||
}
|
||||
if (event->type() == QEvent::StyleChange)
|
||||
{
|
||||
QString colorName = currentColor.name();
|
||||
qreal desiredContrast = Settings->valueFromGroup("Chat", "MinimumContrast", 4.5).toDouble();
|
||||
QColor backgroundColor = ui->chatTextEdit->palette().base().color();
|
||||
RsHtml::findBestColor(colorName, backgroundColor, desiredContrast);
|
||||
|
||||
currentColor = QColor(colorName);
|
||||
ui->chatTextEdit->setTextColor(currentColor);
|
||||
colorChanged();
|
||||
}
|
||||
} else if (obj == ui->leSearch) {
|
||||
if (event->type() == QEvent::KeyPress) {
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user