summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSami Merila <sami.merila@nokia.com>2010-05-06 14:07:53 (GMT)
committerSami Merila <sami.merila@nokia.com>2010-05-06 14:07:53 (GMT)
commitfb74c8dc2f240f9e2c4f64633917ca5bd43c22a1 (patch)
tree1756ee5d830e7bf5bad57e7ed3c897fa066a805f /src
parentf5e56527cbf8aa2bc1b78ff8558ea6f6088a7c66 (diff)
downloadQt-fb74c8dc2f240f9e2c4f64633917ca5bd43c22a1.zip
Qt-fb74c8dc2f240f9e2c4f64633917ca5bd43c22a1.tar.gz
Qt-fb74c8dc2f240f9e2c4f64633917ca5bd43c22a1.tar.bz2
QLineEdit / QDateEdit - white font on white background
Currently QCoeFepInputContext uses default QLineEdit palette when setting up text format before passing the formatted text to native side (which uses it, for example, to show T9 suggested words). The above way is incorrect due to two reasons: - custom widget might not be anything like QLineEdit and might have really different palette from it - it ignores stylesheets (or modifications to the QLineEdit's palette) Therefore, the color for text format is picked up from focusWidget, if it is available (in most cases it should be). If the focusWidget is not available, then QLineEdit default palette is used. Task-number: QTBUG-9480 Reviewed-by: Janne Koskinen
Diffstat (limited to 'src')
-rw-r--r--src/gui/inputmethod/qcoefepinputcontext_s60.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp
index 610ac3c..d081cfd 100644
--- a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp
+++ b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp
@@ -484,9 +484,10 @@ void QCoeFepInputContext::applyHints(Qt::InputMethodHints hints)
void QCoeFepInputContext::applyFormat(QList<QInputMethodEvent::Attribute> *attributes)
{
TCharFormat cFormat;
- QColor styleTextColor = QApplication::palette("QLineEdit").text().color();
- TLogicalRgb tontColor(TRgb(styleTextColor.red(), styleTextColor.green(), styleTextColor.blue(), styleTextColor.alpha()));
- cFormat.iFontPresentation.iTextColor = tontColor;
+ const QColor styleTextColor = focusWidget() ? focusWidget()->palette().text().color() :
+ QApplication::palette("QLineEdit").text().color();
+ const TLogicalRgb fontColor(TRgb(styleTextColor.red(), styleTextColor.green(), styleTextColor.blue(), styleTextColor.alpha()));
+ cFormat.iFontPresentation.iTextColor = fontColor;
TInt numChars = 0;
TInt charPos = 0;