From ec2b89a03d884c5d767a92eddc264d7dbf702470 Mon Sep 17 00:00:00 2001 From: Andras Becsi <andras.becsi@theqtcompany.com> Date: Tue, 18 Aug 2015 17:40:42 +0200 Subject: [PATCH] Use the default composition colors for IME composition We should not set the background color coming from the input method event since its color scheme might not match the color scheme of the web page, which can make the entered text unreadable. Instead we should set the default as used by the aura and mac implementations of transparent background and black underline of the current editing context. Change-Id: I3a4ec5672a917b029fb57cfcc6b36bf93209af2c Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com> --- src/core/render_widget_host_view_qt.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/core/render_widget_host_view_qt.cpp b/src/core/render_widget_host_view_qt.cpp index f2a8055ad..7ca528954 100644 --- a/src/core/render_widget_host_view_qt.cpp +++ b/src/core/render_widget_host_view_qt.cpp @@ -923,14 +923,9 @@ void RenderWidgetHostViewQt::handleInputMethodEvent(QInputMethodEvent *ev) if (preeditString.isEmpty()) break; - QTextCharFormat textCharFormat = attribute.value.value<QTextFormat>().toCharFormat(); - QColor qcolor = textCharFormat.underlineColor(); - QColor qBackgroundColor = textCharFormat.background().color(); - blink::WebColor color = SkColorSetARGB(qcolor.alpha(), qcolor.red(), qcolor.green(), qcolor.blue()); - blink::WebColor backgroundColor = SkColorSetARGB(qBackgroundColor.alpha(), qBackgroundColor.red(), qBackgroundColor.green(), qBackgroundColor.blue()); int start = qMin(attribute.start, (attribute.start + attribute.length)); int end = qMax(attribute.start, (attribute.start + attribute.length)); - underlines.push_back(blink::WebCompositionUnderline(start, end, color, false, backgroundColor)); + underlines.push_back(blink::WebCompositionUnderline(start, end, /*color*/ SK_ColorBLACK, /*thick*/ false, /*backgroundColor*/ SK_ColorTRANSPARENT)); break; } case QInputMethodEvent::Cursor: -- GitLab