Luciano Wolf
unread,Jun 21, 2012, 8:41:52 AM6/21/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to snowsh...@googlegroups.com
Now every time you click an item on TabsGrid the Overlay bar will
show up. The timer event also gets priority over "loading finished".
Reviewed-by: ?
---
src/mobile/qml/NavigationPanel.qml | 25 +++++++++++++++++--------
1 file changed, 17 insertions(+), 8 deletions(-)
diff --git a/src/mobile/qml/NavigationPanel.qml b/src/mobile/qml/NavigationPanel.qml
index cf9afa1..ba85dc0 100644
--- a/src/mobile/qml/NavigationPanel.qml
+++ b/src/mobile/qml/NavigationPanel.qml
@@ -23,6 +23,7 @@ Item {
id: navigationPanel
property bool hasOpennedTabs: TabsModel.count > 0
+ property bool isLocalEvent: false
property alias url: navigationBar.url
property QtObject visibleTab: TabsModel.currentWebView
property QtObject lastVisibleTab
@@ -35,9 +36,10 @@ Item {
Connections {
target: visibleTab
onLoadingChanged: {
- if (navigationPanel.state === "withNavigationBarAndOverlay")
+ if (isLocalEvent)
return;
navigationBarHidingTimer.updateStateForCurrentTab();
+ isLocalEvent = true;
}
}
@@ -69,11 +71,13 @@ Item {
function dismiss() { navigationPanel.state = ""; }
function goToNextTab() {
+ isLocalEvent = true;
if (TabsModel.currentWebViewIndex + 1 < TabsModel.count)
TabsModel.currentWebViewIndex++;
}
function goToPreviousTab() {
+ isLocalEvent = true;
if (TabsModel.currentWebViewIndex > 0)
TabsModel.currentWebViewIndex--;
}
@@ -135,11 +139,10 @@ Item {
}
function updateStateForCurrentTab() {
- if (navigationPanel.visibleTab.loading) {
+ if (!isLocalEvent) {
navigationPanel.state = "withNavigationBarAndOverlay";
- stop();
- } else
restart();
+ }
}
}
@@ -157,13 +160,13 @@ Item {
}
onShowThumbnails: {
- navigationPanel.state = "";
+ navigationBarHidingTimer.stop();
TabsModel.currentWebViewIndex = -1;
}
onOpenNewTab: navigationPanel.newTabRequested()
- onPinToggled: BookmarkModel.togglePin(visibleTab.url);
+ onPinToggled: BookmarkModel.togglePin(visibleTab.url)
Connections {
target: BookmarkModel
@@ -208,8 +211,9 @@ Item {
function openUrl(url)
{
- TabsModel.currentWebView.load(url)
- webViewMaximized()
+ TabsModel.currentWebView.load(url);
+ webViewMaximized();
+ isLocalEvent = false;
}
function openUrlInNewTab(url)
{
@@ -218,6 +222,7 @@ Item {
"z" : -1});
webView.load(url);
TabsModel.append(webView);
+ isLocalEvent = false;
}
onVisibleTabChanged: {
@@ -229,6 +234,10 @@ Item {
visibleTab.visible = true;
webViewMaximized();
tabBar.visible = true;
+ if (isLocalEvent)
+ isLocalEvent = false;
+ else
+ navigationBarHidingTimer.restart();
} else {
webViewMinimized();
tabBar.visible = false;
--
1.7.9.5