summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Markmann <tm@ayena.de>2016-09-12 11:05:38 (GMT)
committerTobias Markmann <tm@ayena.de>2016-10-20 09:54:07 (GMT)
commit7f6e2a0fa9338da89339111aad93d205b5e15ec6 (patch)
tree61d95807afe1880d6a16e01488b60185610bf618 /Swift/QtUI/QtChatWindow.cpp
parenta0199d151c8c0286caa5185988b5604d7e1e2d52 (diff)
downloadswift-7f6e2a0fa9338da89339111aad93d205b5e15ec6.zip
swift-7f6e2a0fa9338da89339111aad93d205b5e15ec6.tar.bz2
Fix focus rect vanishing in trellis mode after sending a message
QtChatWindow was setting and resetting the Qt stylesheet for the chat input for message correction UI. This conflicted with the focus rectangle styling. Moved correction styling inside QtTextEdit which can handle focus rectangle and correction background styling together without overriding each other. On OS X, the native focus rectangle drawing, i.e. setting the Qt::WA_MacShowFocusRect widget attribute on the input, can not be used anymore, as it conflicts with setting the stylesheet for the correction background color. Test-Information: Tested message correction, trellis and security label UI on OS X 10.11.6 and Windows 8 with Qt 5.5.1. Change-Id: I0b771a2d47d5437512e870a9887b0b6e7262b359
Diffstat (limited to 'Swift/QtUI/QtChatWindow.cpp')
-rw-r--r--Swift/QtUI/QtChatWindow.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/Swift/QtUI/QtChatWindow.cpp b/Swift/QtUI/QtChatWindow.cpp
index 0da4563..bda6b3e 100644
--- a/Swift/QtUI/QtChatWindow.cpp
+++ b/Swift/QtUI/QtChatWindow.cpp
@@ -311,7 +311,7 @@ void QtChatWindow::beginCorrection() {
cursor.endEditBlock();
isCorrection_ = true;
correctingLabel_->show();
- input_->setStyleSheet(alertStyleSheet_);
+ input_->setCorrectionHighlight(true);
labelsWidget_->setEnabled(false);
}
@@ -325,7 +325,7 @@ void QtChatWindow::cancelCorrection() {
cursor.removeSelectedText();
isCorrection_ = false;
correctingLabel_->hide();
- input_->setStyleSheet(qApp->styleSheet());
+ input_->setCorrectionHighlight(false);
labelsWidget_->setEnabled(true);
}
@@ -844,10 +844,7 @@ std::string QtChatWindow::getID() const {
}
void QtChatWindow::setEmphasiseFocus(bool emphasise) {
- input_->setAttribute(Qt::WA_MacShowFocusRect, emphasise);
-#ifdef SWIFTEN_PLATFORM_WINDOWS
input_->setEmphasiseFocus(emphasise);
-#endif
}
void QtChatWindow::showRoomConfigurationForm(Form::ref form) {