diff options
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/dialogs/qcolordialog.cpp | 6 | ||||
-rw-r--r-- | src/gui/egl/qegl_symbian.cpp | 4 | ||||
-rw-r--r-- | src/gui/inputmethod/qcoefepinputcontext_s60.cpp | 5 | ||||
-rw-r--r-- | src/gui/styles/qs60style.cpp | 37 | ||||
-rw-r--r-- | src/gui/styles/qs60style_p.h | 3 | ||||
-rw-r--r-- | src/gui/util/qdesktopservices_s60.cpp | 4 |
6 files changed, 41 insertions, 18 deletions
diff --git a/src/gui/dialogs/qcolordialog.cpp b/src/gui/dialogs/qcolordialog.cpp index 83ecc30..e6abf7f 100644 --- a/src/gui/dialogs/qcolordialog.cpp +++ b/src/gui/dialogs/qcolordialog.cpp @@ -1078,8 +1078,7 @@ QColorShower::QColorShower(QColorDialog *parent) #ifdef QT_SMALL_COLORDIALOG # ifdef Q_WS_S60 - QS60Data s60Data = QS60Data(); - const bool nonTouchUI = !s60Data.hasTouchscreen; + const bool nonTouchUI = !S60->hasTouchscreen; # elif defined Q_WS_MAEMO_5 const bool nonTouchUI = false; # endif @@ -1506,8 +1505,7 @@ void QColorDialogPrivate::init(const QColor &initial) #if defined(QT_SMALL_COLORDIALOG) # if defined(Q_WS_S60) - QS60Data s60Data = QS60Data(); - const bool nonTouchUI = !s60Data.hasTouchscreen; + const bool nonTouchUI = !S60->hasTouchscreen; # elif defined(Q_WS_MAEMO_5) const bool nonTouchUI = false; # endif diff --git a/src/gui/egl/qegl_symbian.cpp b/src/gui/egl/qegl_symbian.cpp index b1c9408..5a010cd 100644 --- a/src/gui/egl/qegl_symbian.cpp +++ b/src/gui/egl/qegl_symbian.cpp @@ -78,9 +78,9 @@ EGLSurface QEglContext::createSurface(QPaintDevice *device, const QEglProperties props = 0; EGLSurface surf; if (devType == QInternal::Widget) - surf = eglCreateWindowSurface(dpy, cfg, windowDrawable, 0); + surf = eglCreateWindowSurface(dpy, cfg, windowDrawable, props); else - surf = eglCreatePixmapSurface(dpy, cfg, pixmapDrawable, 0); + surf = eglCreatePixmapSurface(dpy, cfg, pixmapDrawable, props); if (surf == EGL_NO_SURFACE) qWarning("QEglContext::createSurface(): Unable to create EGL surface, error = 0x%x", eglGetError()); return surf; diff --git a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp index 2b91711..1ac8ace 100644 --- a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp +++ b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp @@ -113,7 +113,7 @@ void QCoeFepInputContext::update() updateHints(false); // For pre-5.0 SDKs, we don't do text updates on S60 side. - if (QSysInfo::s60Version() != QSysInfo::SV_S60_5_0) { + if (QSysInfo::s60Version() < QSysInfo::SV_S60_5_0) { return; } @@ -740,6 +740,9 @@ void QCoeFepInputContext::GetScreenCoordinatesForFepL(TPoint& aLeftSideOfBaseLin void QCoeFepInputContext::DoCommitFepInlineEditL() { commitCurrentString(false); + if (QSysInfo::s60Version() > QSysInfo::SV_S60_5_0) + ReportAknEdStateEvent(QT_EAknCursorPositionChanged); + } void QCoeFepInputContext::commitCurrentString(bool cancelFepTransaction) diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp index ea7399f..565cc2c 100644 --- a/src/gui/styles/qs60style.cpp +++ b/src/gui/styles/qs60style.cpp @@ -120,6 +120,8 @@ QPixmap *QS60StylePrivate::m_background = 0; // theme palette QPalette *QS60StylePrivate::m_themePalette = 0; +qint64 QS60StylePrivate::m_webPaletteKey = 0; + const struct QS60StylePrivate::frameElementCenter QS60StylePrivate::m_frameElementsData[] = { {SE_ButtonNormal, QS60StyleEnums::SP_QsnFrButtonTbCenter}, {SE_ButtonPressed, QS60StyleEnums::SP_QsnFrButtonTbCenterPressed}, @@ -807,8 +809,12 @@ void QS60StylePrivate::setThemePaletteHash(QPalette *palette) const QPalette webPalette = *palette; webPalette.setColor(QPalette::WindowText, Qt::black); webPalette.setColor(QPalette::Text, Qt::black); + webPalette.setBrush(QPalette::Base, Qt::white); + QApplication::setPalette(webPalette, "QWebView"); QApplication::setPalette(webPalette, "QGraphicsWebView"); + + m_webPaletteKey = webPalette.cacheKey(); } QSize QS60StylePrivate::partSize(QS60StyleEnums::SkinParts part, SkinElementFlags flags) @@ -896,8 +902,11 @@ QSize QS60StylePrivate::partSize(QS60StyleEnums::SkinParts part, SkinElementFlag return result; } -bool QS60StylePrivate::canDrawThemeBackground(const QBrush &backgroundBrush) +bool QS60StylePrivate::canDrawThemeBackground(const QBrush &backgroundBrush, const QWidget *widget) { + // Always return true for web pages. + if (widget && m_webPaletteKey == QApplication::palette(widget).cacheKey()) + return true; //If brush is not changed from style's default values, draw theme graphics. return (backgroundBrush.color() == Qt::transparent || backgroundBrush.style() == Qt::NoBrush) ? true : false; @@ -1901,7 +1910,7 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option, case CE_ShapedFrame: if (const QTextEdit *textEdit = qobject_cast<const QTextEdit *>(widget)) { const QStyleOptionFrame *frame = qstyleoption_cast<const QStyleOptionFrame *>(option); - if (QS60StylePrivate::canDrawThemeBackground(frame->palette.base())) + if (QS60StylePrivate::canDrawThemeBackground(frame->palette.base(), widget)) QS60StylePrivate::drawSkinElement(QS60StylePrivate::SE_Editor, painter, option->rect, flags); else QCommonStyle::drawControl(element, option, painter, widget); @@ -2013,7 +2022,7 @@ void QS60Style::drawPrimitive(PrimitiveElement element, const QStyleOption *opti if (widget && qobject_cast<const QComboBox *>(widget->parentWidget())) break; #endif - if (QS60StylePrivate::canDrawThemeBackground(option->palette.base())) + if (QS60StylePrivate::canDrawThemeBackground(option->palette.base(), widget)) QS60StylePrivate::drawSkinElement(QS60StylePrivate::SE_FrameLineEdit, painter, option->rect, flags); else commonStyleDraws = true; @@ -2093,7 +2102,7 @@ void QS60Style::drawPrimitive(PrimitiveElement element, const QStyleOption *opti case PE_PanelButtonTool: case PE_PanelButtonBevel: case PE_FrameButtonBevel: - if (QS60StylePrivate::canDrawThemeBackground(option->palette.base())) { + if (QS60StylePrivate::canDrawThemeBackground(option->palette.base(), widget)) { const bool isPressed = option->state & State_Sunken; const QS60StylePrivate::SkinElements skinElement = isPressed ? QS60StylePrivate::SE_ButtonPressed : QS60StylePrivate::SE_ButtonNormal; @@ -2125,7 +2134,7 @@ void QS60Style::drawPrimitive(PrimitiveElement element, const QStyleOption *opti case PE_IndicatorSpinDown: case PE_IndicatorSpinUp: if (const QStyleOptionSpinBox *spinBox = qstyleoption_cast<const QStyleOptionSpinBox *>(option)) { - if (QS60StylePrivate::canDrawThemeBackground(spinBox->palette.base())) { + if (QS60StylePrivate::canDrawThemeBackground(spinBox->palette.base(), widget)) { QStyleOptionSpinBox optionSpinBox = *spinBox; const QS60StyleEnums::SkinParts part = (element == PE_IndicatorSpinUp) ? QS60StyleEnums::SP_QgnGrafScrollArrowUp : @@ -2140,7 +2149,7 @@ void QS60Style::drawPrimitive(PrimitiveElement element, const QStyleOption *opti #endif //QT_NO_SPINBOX #ifndef QT_NO_COMBOBOX if (const QStyleOptionFrame *cmb = qstyleoption_cast<const QStyleOptionFrame *>(option)) { - if (QS60StylePrivate::canDrawThemeBackground( option->palette.base())) { + if (QS60StylePrivate::canDrawThemeBackground( option->palette.base(), widget)) { // We want to draw down arrow here for comboboxes as well. QStyleOptionFrame optionsComboBox = *cmb; const QS60StyleEnums::SkinParts part = QS60StyleEnums::SP_QgnGrafScrollArrowDown; @@ -2179,7 +2188,7 @@ void QS60Style::drawPrimitive(PrimitiveElement element, const QStyleOption *opti #endif //QT_NO_MENU ) { //Need extra check since dialogs have their own theme background - if (QS60StylePrivate::canDrawThemeBackground(option->palette.base()) && + if (QS60StylePrivate::canDrawThemeBackground(option->palette.base(), widget) && option->palette.window().texture().cacheKey() == QS60StylePrivate::m_themePalette->window().texture().cacheKey()) QS60StylePrivate::drawSkinElement(QS60StylePrivate::SE_OptionsMenu, painter, option->rect, flags); @@ -2387,10 +2396,20 @@ QSize QS60Style::sizeFromContents(ContentsType ct, const QStyleOption *opt, case CT_PushButton: sz = QCommonStyle::sizeFromContents( ct, opt, csz, widget); //FIXME properly - style should calculate the location of border frame-part - sz += QSize(2 * pixelMetric(PM_ButtonMargin), 2 * pixelMetric(PM_ButtonMargin)); - if (const QAbstractButton *buttonWidget = (qobject_cast<const QAbstractButton *>(widget))) + if (const QAbstractButton *buttonWidget = (qobject_cast<const QAbstractButton *>(widget))) { if (buttonWidget->isCheckable()) sz += QSize(pixelMetric(PM_IndicatorWidth) + pixelMetric(PM_CheckBoxLabelSpacing), 0); + const int iconHeight = (!buttonWidget->icon().isNull()) ? buttonWidget->iconSize().height() : 0; + const int textHeight = (buttonWidget->text().length() > 0) ? + buttonWidget->fontMetrics().size(Qt::TextSingleLine, buttonWidget->text()).height() : 0; + const int decoratorHeight = (buttonWidget->isCheckable()) ? pixelMetric(PM_IndicatorHeight) : 0; + + const int contentHeight = + qMax(qMax(iconHeight, decoratorHeight) + pixelMetric(PM_ButtonMargin), + textHeight + 2*pixelMetric(PM_ButtonMargin)); + sz.setHeight(contentHeight); + sz += QSize(2 * pixelMetric(PM_ButtonMargin), 0); + } break; case CT_LineEdit: if (const QStyleOptionFrame *f = qstyleoption_cast<const QStyleOptionFrame *>(opt)) diff --git a/src/gui/styles/qs60style_p.h b/src/gui/styles/qs60style_p.h index ea30b81..16d82e7 100644 --- a/src/gui/styles/qs60style_p.h +++ b/src/gui/styles/qs60style_p.h @@ -542,7 +542,7 @@ public: //Checks that the current brush is transparent or has BrushStyle NoBrush, //so that theme graphic background can be drawn. - static bool canDrawThemeBackground(const QBrush &backgroundBrush); + static bool canDrawThemeBackground(const QBrush &backgroundBrush, const QWidget *widget); static int currentAnimationFrame(QS60StyleEnums::SkinParts part); #ifdef Q_WS_S60 @@ -596,6 +596,7 @@ private: QPalette m_originalPalette; QPointer<QFocusFrame> m_focusFrame; + static qint64 m_webPaletteKey; #ifdef Q_WS_S60 //list of progress bars having animation running diff --git a/src/gui/util/qdesktopservices_s60.cpp b/src/gui/util/qdesktopservices_s60.cpp index 319c4b0..adc4fc1 100644 --- a/src/gui/util/qdesktopservices_s60.cpp +++ b/src/gui/util/qdesktopservices_s60.cpp @@ -48,7 +48,6 @@ #include <qurl.h> #include <private/qcore_symbian_p.h> -#include <miutset.h> // KUidMsgTypeSMTP #include <txtrich.h> // CRichText #include <f32file.h> // TDriveUnit etc #include <eikenv.h> // CEikonEnv @@ -57,6 +56,9 @@ #include <rsendas.h> // RSendAs #include <rsendasmessage.h> // RSendAsMessage +// copied from miutset.h, so we don't get a dependency into the app layer +const TUid KUidMsgTypeSMTP = {0x10001028}; // 268439592 + #ifdef Q_WS_S60 # include <pathinfo.h> // PathInfo # ifdef USE_DOCUMENTHANDLER |