From b92b103d1b88760ff5b05163865593be6e937b07 Mon Sep 17 00:00:00 2001 From: Sami Merila Date: Mon, 15 Feb 2010 08:55:42 +0200 Subject: QS60Style draws drop area as a black rect When Drag-n-Dropping elements in itemviews QS60Style draws drop area as a black rect. Change this so that native graphics are used instead. This change only affects touch-devices as non-touch 3.x devices do not have the native graphics defined. In 3.x non-touch devices, style still uses QCommonStyle to draw the DropArea. Task-number: QTBUG-8193 Reviewed-by: Alessandro Portale --- src/gui/styles/qs60style.cpp | 11 +++++++++-- src/gui/styles/qs60style_p.h | 2 ++ src/gui/styles/qs60style_s60.cpp | 1 + 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp index 7372c3c..8f253cd 100644 --- a/src/gui/styles/qs60style.cpp +++ b/src/gui/styles/qs60style.cpp @@ -289,6 +289,9 @@ void QS60StylePrivate::drawSkinElement(SkinElements element, QPainter *painter, case SE_Editor: drawFrame(SF_FrameLineEdit, painter, rect, flags | SF_PointNorth); break; + case SE_DropArea: + drawPart(QS60StyleEnums::SP_QgnGrafOrgBgGrid, painter, rect, flags | SF_PointNorth); + break; default: break; } @@ -2302,7 +2305,12 @@ void QS60Style::drawPrimitive(PrimitiveElement element, const QStyleOption *opti break; case PE_PanelScrollAreaCorner: break; - + case PE_IndicatorItemViewItemDrop: + if (QS60StylePrivate::isTouchSupported()) + QS60StylePrivate::drawSkinElement(QS60StylePrivate::SE_DropArea, painter, option->rect, flags); + else + commonStyleDraws = true; + break; // todo: items are below with #ifdefs "just in case". in final version, remove all non-required cases case PE_FrameLineEdit: case PE_IndicatorDockWidgetResizeHandle: @@ -2323,7 +2331,6 @@ void QS60Style::drawPrimitive(PrimitiveElement element, const QStyleOption *opti #endif //QT_NO_TOOLBAR #ifndef QT_NO_COLUMNVIEW case PE_IndicatorColumnViewArrow: - case PE_IndicatorItemViewItemDrop: #endif //QT_NO_COLUMNVIEW case PE_FrameTabBarBase: // since tabs are in S60 always in navipane, let's use common style for tab base in Qt. default: diff --git a/src/gui/styles/qs60style_p.h b/src/gui/styles/qs60style_p.h index eae2291..0119398 100644 --- a/src/gui/styles/qs60style_p.h +++ b/src/gui/styles/qs60style_p.h @@ -131,6 +131,7 @@ public: SP_QgnGrafBarFrameSideL, SP_QgnGrafBarFrameSideR, SP_QgnGrafBarProgress, + SP_QgnGrafOrgBgGrid SP_QgnGrafScrollArrowDown, SP_QgnGrafScrollArrowLeft, SP_QgnGrafScrollArrowRight, @@ -428,6 +429,7 @@ public: SE_ScrollBarHandlePressedVertical, SE_ButtonInactive, SE_Editor, + SE_DropArea }; enum SkinFrameElements { diff --git a/src/gui/styles/qs60style_s60.cpp b/src/gui/styles/qs60style_s60.cpp index 872bc2b..e9b2da8 100644 --- a/src/gui/styles/qs60style_s60.cpp +++ b/src/gui/styles/qs60style_s60.cpp @@ -178,6 +178,7 @@ const partMapEntry QS60StyleModeSpecifics::m_partMap[] = { /* SP_QgnGrafBarFrameSideL */ {KAknsIIDQgnGrafBarFrameSideL, EDrawIcon, ES60_All, -1,-1}, /* SP_QgnGrafBarFrameSideR */ {KAknsIIDQgnGrafBarFrameSideR, EDrawIcon, ES60_All, -1,-1}, /* SP_QgnGrafBarProgress */ {KAknsIIDQgnGrafBarProgress, EDrawIcon, ES60_All, -1,-1}, + /* SP_QgnGrafOrgBgGrid */ {KAknsIIDQgnGrafOrgBgGrid, EDrawIcon, ES60_All, -1,-1}, /* SP_QgnGrafScrollArrowDown */ {KAknsIIDQgnGrafScrollArrowDown, EDrawGulIcon, ES60_All, -1,-1}, /* SP_QgnGrafScrollArrowLeft */ {KAknsIIDQgnGrafScrollArrowLeft, EDrawGulIcon, ES60_All, -1,-1}, /* SP_QgnGrafScrollArrowRight */ {KAknsIIDQgnGrafScrollArrowRight, EDrawGulIcon, ES60_All, -1,-1}, -- cgit v0.12