diff options
author | Marcelo Lira <marcelo.lira@openbossa.org> | 2012-05-28 17:42:51 -0300 |
---|---|---|
committer | Marcelo Lira <marcelo.lira@openbossa.org> | 2012-05-28 17:52:33 -0300 |
commit | c855af4fc467c5d1a759724e584432e8f6cef466 (patch) | |
tree | a5e793dc48e264ec6a9938c4d69dc1c150a5fa6b | |
parent | 0558361566a5c95b1110d95b53d067e836fd9ec2 (diff) |
The WebView overlay is just a swipe area now.
Swipe left and right to move through open tabs, click in the
SwipeArea to go back to fullscreen view.
The SwipeArea is in fact transparent, so the user will be under
the impression of interacting with the WebView.
Reviewed-by: Hugo Parente Lima
-rw-r--r-- | src/mobile/qml/NavigationOverlay.qml | 48 | ||||
-rw-r--r-- | src/mobile/qml/NavigationPanel.qml | 26 |
2 files changed, 8 insertions, 66 deletions
diff --git a/src/mobile/qml/NavigationOverlay.qml b/src/mobile/qml/NavigationOverlay.qml deleted file mode 100644 index 0aacc71..0000000 --- a/src/mobile/qml/NavigationOverlay.qml +++ /dev/null @@ -1,48 +0,0 @@ -/**************************************************************************** - * Copyright (C) 2012 Instituto Nokia de Tecnologia (INdT) * - * * - * This file may be used under the terms of the GNU Lesser * - * General Public License version 2.1 as published by the Free Software * - * Foundation and appearing in the file LICENSE.LGPL included in the * - * packaging of this file. Please review the following information to * - * ensure the GNU Lesser General Public License version 2.1 requirements * - * will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU Lesser General Public License for more details. * - ****************************************************************************/ - -import QtQuick 2.0 - -Rectangle { - id: overlay - color: "black" - opacity: 0 - - signal showThumbnails() - signal closeTab() - signal dismissOverlay() - signal goToPreviousTab() - signal goToNextTab() - - Text { - anchors.centerIn: parent - color: "white" - font.bold: true - font.pixelSize: 20 - text: "Swipe Left/Right to change tabs\nSwipe Down to close tab\nSwipe Up to show thumbnails\nClick to dismiss overlay" - horizontalAlignment: Text.AlignHCenter - } - - SwipeArea { - anchors.fill: parent - - onSwipeUp: overlay.showThumbnails() - onSwipeDown: overlay.closeTab() - onSwipeLeft: overlay.goToNextTab() - onSwipeRight: overlay.goToPreviousTab() - onClicked: overlay.dismissOverlay() - } -} diff --git a/src/mobile/qml/NavigationPanel.qml b/src/mobile/qml/NavigationPanel.qml index 66eb309..31ff1fb 100644 --- a/src/mobile/qml/NavigationPanel.qml +++ b/src/mobile/qml/NavigationPanel.qml @@ -151,7 +151,7 @@ Item { visible: !tabBarRow.visible } - NavigationOverlay { + SwipeArea { id: overlay visible: false anchors { @@ -161,29 +161,21 @@ Item { right: parent.right } - onShowThumbnails: { - navigationPanel.state = ""; - TabsModel.currentWebViewIndex = index; - } - - onCloseTab: { - TabsModel.remove(TabsModel.currentWebViewIndex); - navigationPanel.state = ""; - } + function dismiss() { navigationPanel.state = ""; } - onDismissOverlay: { - navigationPanel.state = ""; - } - - onGoToNextTab: { + function goToNextTab() { if (TabsModel.currentWebViewIndex + 1 < TabsModel.count) TabsModel.currentWebViewIndex++; } - onGoToPreviousTab: { + function goToPreviousTab() { if (TabsModel.currentWebViewIndex > 0) TabsModel.currentWebViewIndex--; } + + onSwipeLeft: overlay.goToNextTab() + onSwipeRight: overlay.goToPreviousTab() + onClicked: overlay.dismiss() } OverlayBar { @@ -299,7 +291,6 @@ Item { name: "withNavigationBarAndOverlay" extend: "withNavigationBar" PropertyChanges { target: overlay; visible: true } - PropertyChanges { target: overlay; opacity: 0.5 } AnchorChanges { target: overlayBar; anchors.top: undefined; anchors.bottom: navigationBar.top } StateChangeScript { script: navigationBarHidingTimer.stop() } PropertyChanges { @@ -320,7 +311,6 @@ Item { AnchorAnimation { duration: 100 } PropertyAnimation { target: visibleTab; properties: "height"; duration: 100 } PropertyAnimation { target: barsBackground; properties: "height"; duration: 100 } - PropertyAnimation { target: overlay; properties: "opacity"; duration: 200 } } Component { |