diff -r e5618cc85d74 -r 6c158198356e javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/src/swtcomposite.cpp --- a/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/src/swtcomposite.cpp Thu Jul 15 18:31:06 2010 +0300 +++ b/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/src/swtcomposite.cpp Thu Aug 19 09:48:13 2010 +0300 @@ -692,6 +692,22 @@ void CSwtComposite::PositionChanged() { + if (IsShell()) + { + const TInt childCount = iChildren.Count(); + for (TInt i = 0; i < childCount; ++i) + { + MSwtControl* child = iChildren[i]; + // We reset the position of child control in order to + // correctly display scrollbar's background + if (!child->IsShell() && child->ScrollableInterface()) + { + CCoeControl& coeChild = child->CoeControl(); + TPoint pos(coeChild.Position()); + coeChild.SetPosition(pos); + } + } + } RectChanged(); HandlePositionChanged(); } @@ -976,6 +992,20 @@ } } +void CSwtComposite::HandleHighlightChange() +{ + TInt count = iChildren.Count(); + + for (TInt i = 0; i < count; ++i) + { + MSwtControl* child = iChildren[i]; + if (!child->IsShell()) + { + child->HandleHighlightChange(); + } + } +} + void CSwtComposite::DrawScrollBarBackground(const TRect& aRect) const { const CCoeControl& coeControl = CoeControl(); @@ -1419,7 +1449,7 @@ // From MAknPhysicsObserver void CSwtComposite::ViewPositionChanged(const TPoint& aNewPosition, - TBool aDrawNow, TUint /*aFlags*/) + TBool /*aDrawNow*/, TUint /*aFlags*/) { if (!iScrlCompContent || iPhysicsViewPos == aNewPosition) { @@ -1468,24 +1498,24 @@ coeCtrl.SetPosition(TPoint(x, y)); iPhysicsViewPos = aNewPosition; - if (aDrawNow) + if (iVScroll) + { + TInt pos = viewRect.iTl.iY - y; // composite coords + pos = Min(pos, iVScroll->GetMaximum()); + pos = Max(pos, 0); + TRAP_IGNORE(iVScroll->DoSetThumbPositionL(pos)); + } + if (iHScroll) { - if (iVScroll) - { - TInt pos = viewRect.iTl.iY - y; // composite coords - pos = Min(pos, iVScroll->GetMaximum()); - pos = Max(pos, 0); - TRAP_IGNORE(iVScroll->DoSetThumbPositionL(pos)); - } - if (iHScroll) - { - TInt pos = viewRect.iTl.iX - x; // composite coords - pos = Min(pos, iHScroll->GetMaximum()); - pos = Max(pos, 0); - TRAP_IGNORE(iHScroll->DoSetThumbPositionL(pos)); - } - PaintUrgently(); + TInt pos = viewRect.iTl.iX - x; // composite coords + pos = Min(pos, iHScroll->GetMaximum()); + pos = Max(pos, 0); + TRAP_IGNORE(iHScroll->DoSetThumbPositionL(pos)); } + // We have to always repaint the composite, since after setPosition + // some child controls might redraw themselves. This can cause distortions + // while panning the composite. + PaintUrgently(); #ifdef RD_JAVA_ADVANCED_TACTILE_FEEDBACK // Flicking or panning the composite content should give the feedback