summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Smith <git@kismith.co.uk>2011-08-21 18:32:25 (GMT)
committerKevin Smith <git@kismith.co.uk>2011-08-21 18:38:00 (GMT)
commit6dc34a78b9e392b7a089dc4ec5100b0061fd88eb (patch)
treeafca700aa53736e18e095d2a1592777812e3ab4b
parent8d6a78665b79a382dc1871852ed7bd150263db79 (diff)
downloadswift-6dc34a78b9e392b7a089dc4ec5100b0061fd88eb.zip
swift-6dc34a78b9e392b7a089dc4ec5100b0061fd88eb.tar.bz2
Colour alert messages.
Resolves: #964 Resolves: #966
-rw-r--r--Swift/QtUI/QtChatWindow.cpp10
-rw-r--r--Swift/QtUI/QtChatWindow.h1
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_;
};
}