Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 455e3af1 authored by Grace Kloba's avatar Grace Kloba
Browse files

Fix #2048199. Enable zoom control in the overview mode. When "+" is pressed,

treat it as double click in the middle of the page.
parent 0749dcd1
Loading
Loading
Loading
Loading
+14 −6
Original line number Diff line number Diff line
@@ -743,7 +743,7 @@ public class WebView extends AbsoluteLayout

    private void updateZoomButtonsEnabled() {
        boolean canZoomIn = mActualScale < mMaxZoomScale;
        boolean canZoomOut = mActualScale > mMinZoomScale;
        boolean canZoomOut = mActualScale > mMinZoomScale && !mInZoomOverview;
        if (!canZoomIn && !canZoomOut) {
            // Hide the zoom in and out buttons, as well as the fit to page
            // button, if the page cannot zoom
@@ -3890,7 +3890,7 @@ public class WebView extends AbsoluteLayout
                        nativeHideCursor();
                    }
                    WebSettings settings = getSettings();
                    if (settings.supportZoom() && !mInZoomOverview
                    if (settings.supportZoom()
                            && settings.getBuiltInZoomControls()
                            && !mZoomButtonsController.isVisible()
                            && (canZoomScrollOut() ||
@@ -3959,7 +3959,7 @@ public class WebView extends AbsoluteLayout
                    mUserScroll = true;
                }

                if (!getSettings().getBuiltInZoomControls() && !mInZoomOverview) {
                if (!getSettings().getBuiltInZoomControls()) {
                    boolean showPlusMinus = mMinZoomScale < mMaxZoomScale;
                    boolean showMagnify = canZoomScrollOut();
                    if (mZoomControls != null && (showPlusMinus || showMagnify)) {
@@ -4544,10 +4544,18 @@ public class WebView extends AbsoluteLayout
        // TODO: alternatively we can disallow this during draw history mode
        switchOutDrawHistory();
        // Center zooming to the center of the screen.
        if (mInZoomOverview) {
            // if in overview mode, bring it back to normal mode
            mLastTouchX = getViewWidth() * .5f;
            mLastTouchY = getViewHeight() * .5f;
            doDoubleTap();
            return true;
        } else {
            mZoomCenterX = getViewWidth() * .5f;
            mZoomCenterY = getViewHeight() * .5f;
            return zoomWithPreview(mActualScale * 1.25f);
        }
    }

    /**
     * Perform zoom out in the webview