diff options
-rw-r--r-- | Swift/QtUI/QtChatWindow.cpp | 10 | ||||
-rw-r--r-- | Swift/QtUI/QtChatWindow.h | 1 |
2 files changed, 9 insertions, 2 deletions
diff --git a/Swift/QtUI/QtChatWindow.cpp b/Swift/QtUI/QtChatWindow.cpp index c7a6fa8..d7ffc65 100644 --- a/Swift/QtUI/QtChatWindow.cpp +++ b/Swift/QtUI/QtChatWindow.cpp @@ -43,6 +43,8 @@ QtChatWindow::QtChatWindow(const QString &contact, QtChatTheme* theme, UIEventSt updateTitleWithUnreadCount(); QtSettingsProvider settings; + alertStyleSheet_ = "background: rgb(255, 255, 153); color: black"; + QBoxLayout *layout = new QBoxLayout(QBoxLayout::TopToBottom, this); layout->setContentsMargins(0,0,0,0); layout->setSpacing(2); @@ -58,8 +60,8 @@ QtChatWindow::QtChatWindow(const QString &contact, QtChatTheme* theme, UIEventSt QPalette palette = alertWidget_->palette(); palette.setColor(QPalette::Window, QColor(Qt::yellow)); palette.setColor(QPalette::WindowText, QColor(Qt::black)); - alertWidget_->setPalette(palette); - alertLabel_->setPalette(palette); + alertWidget_->setStyleSheet(alertStyleSheet_); + alertLabel_->setStyleSheet(alertStyleSheet_); alertWidget_->hide(); logRosterSplitter_ = new QSplitter(this); @@ -114,6 +116,8 @@ QtChatWindow::QtChatWindow(const QString &contact, QtChatTheme* theme, UIEventSt connect(messageLog_, SIGNAL(gotFocus()), input_, SLOT(setFocus())); resize(400,300); connect(messageLog_, SIGNAL(fontResized(int)), this, SIGNAL(fontResized(int))); + + } QtChatWindow::~QtChatWindow() { @@ -194,6 +198,7 @@ void QtChatWindow::beginCorrection() { cursor.endEditBlock(); isCorrection_ = true; correctingLabel_->show(); + input_->setStyleSheet(alertStyleSheet_); } void QtChatWindow::cancelCorrection() { @@ -203,6 +208,7 @@ void QtChatWindow::cancelCorrection() { cursor.removeSelectedText(); isCorrection_ = false; correctingLabel_->hide(); + input_->setStyleSheet(qApp->styleSheet()); } QByteArray QtChatWindow::getSplitterState() { diff --git a/Swift/QtUI/QtChatWindow.h b/Swift/QtUI/QtChatWindow.h index bc2d821..bc1045d 100644 --- a/Swift/QtUI/QtChatWindow.h +++ b/Swift/QtUI/QtChatWindow.h @@ -123,5 +123,6 @@ namespace Swift { IDGenerator id_; QSplitter *logRosterSplitter_; Tristate correctionEnabled_; + QString alertStyleSheet_; }; } |