Title: [114370] trunk/Source/WebKit2
- Revision
- 114370
- Author
- commit-qu...@webkit.org
- Date
- 2012-04-17 06:14:50 -0700 (Tue, 17 Apr 2012)
Log Message
[Qt] Zoom out on second double-tap.
https://bugs.webkit.org/show_bug.cgi?id=84145
Patch by Allan Sandfeld Jensen <allan.jen...@nokia.com> on 2012-04-17
Reviewed by Simon Hausmann.
* UIProcess/qt/QtViewportInteractionEngine.cpp:
(WebKit::QtViewportInteractionEngine::QtViewportInteractionEngine):
(WebKit::QtViewportInteractionEngine::zoomToAreaGestureEnded):
(WebKit::QtViewportInteractionEngine::pinchGestureStarted):
* UIProcess/qt/QtViewportInteractionEngine.h:
(QtViewportInteractionEngine):
Modified Paths
Diff
Modified: trunk/Source/WebKit2/ChangeLog (114369 => 114370)
--- trunk/Source/WebKit2/ChangeLog 2012-04-17 13:10:45 UTC (rev 114369)
+++ trunk/Source/WebKit2/ChangeLog 2012-04-17 13:14:50 UTC (rev 114370)
@@ -1,3 +1,17 @@
+2012-04-17 Allan Sandfeld Jensen <allan.jen...@nokia.com>
+
+ [Qt] Zoom out on second double-tap.
+ https://bugs.webkit.org/show_bug.cgi?id=84145
+
+ Reviewed by Simon Hausmann.
+
+ * UIProcess/qt/QtViewportInteractionEngine.cpp:
+ (WebKit::QtViewportInteractionEngine::QtViewportInteractionEngine):
+ (WebKit::QtViewportInteractionEngine::zoomToAreaGestureEnded):
+ (WebKit::QtViewportInteractionEngine::pinchGestureStarted):
+ * UIProcess/qt/QtViewportInteractionEngine.h:
+ (QtViewportInteractionEngine):
+
2012-04-17 Mariusz Grzegorczyk <marius...@samsung.com>
[EFL][WK2] Fix build break when CONTEXT_MENUS is disabled.
Modified: trunk/Source/WebKit2/UIProcess/qt/QtViewportInteractionEngine.cpp (114369 => 114370)
--- trunk/Source/WebKit2/UIProcess/qt/QtViewportInteractionEngine.cpp 2012-04-17 13:10:45 UTC (rev 114369)
+++ trunk/Source/WebKit2/UIProcess/qt/QtViewportInteractionEngine.cpp 2012-04-17 13:14:50 UTC (rev 114370)
@@ -125,6 +125,7 @@
, m_suspendCount(0)
, m_hasSuspendedContent(false)
, m_hadUserInteraction(false)
+ , m_zoomedToArea(false)
, m_scaleAnimation(new ScaleAnimation(this))
, m_pinchStartScale(-1)
{
@@ -363,7 +364,7 @@
if (scrollAnimationActive() || scaleAnimationActive())
return;
- const int margin = 10; // We want at least a little bit or margin.
+ const int margin = 10; // We want at least a little bit of margin.
QRectF endArea = itemRectFromCSS(targetArea.adjusted(-margin, -margin, margin, margin));
const QRectF viewportRect = m_viewport->boundingRect();
@@ -371,6 +372,13 @@
qreal targetCSSScale = cssScaleFromItem(viewportRect.size().width() / endArea.size().width());
qreal endItemScale = itemScaleFromCSS(innerBoundedCSSScale(qMin(targetCSSScale, qreal(2.5))));
+ // Zoom back out on a second double click, but still center on the new touch point.
+ if (m_zoomedToArea) {
+ m_zoomedToArea = false;
+ endItemScale = 1.0;
+ } else
+ m_zoomedToArea = true;
+
// We want to end up with the target area filling the whole width of the viewport (if possible),
// and centralized vertically where the user requested zoom. Thus our hotspot is the center of
// the targetArea x-wise and the requested zoom position, y-wise.
@@ -525,6 +533,7 @@
return;
m_hadUserInteraction = true;
+ m_zoomedToArea = false;
m_scaleUpdateDeferrer = adoptPtr(new ViewportUpdateDeferrer(this, ViewportUpdateDeferrer::DeferUpdateAndSuspendContent));
Modified: trunk/Source/WebKit2/UIProcess/qt/QtViewportInteractionEngine.h (114369 => 114370)
--- trunk/Source/WebKit2/UIProcess/qt/QtViewportInteractionEngine.h 2012-04-17 13:10:45 UTC (rev 114369)
+++ trunk/Source/WebKit2/UIProcess/qt/QtViewportInteractionEngine.h 2012-04-17 13:14:50 UTC (rev 114370)
@@ -145,6 +145,7 @@
OwnPtr<ViewportUpdateDeferrer> m_touchUpdateDeferrer;
bool m_hadUserInteraction;
+ bool m_zoomedToArea;
class ScaleAnimation : public QVariantAnimation {
public:
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes