From f6bfc3ec724d91ff39b141a8529935c071ef7549 Mon Sep 17 00:00:00 2001 From: Hugo Parente Lima Date: Mon, 18 Jun 2012 15:09:21 -0300 Subject: The designers changed their minds about the start up behavior, so reverting this commit to implement yet another different behavior. Revert "Enable all panels (tabs and favorites) no matter if there's no webpages opened or favorites registered." This reverts commit b38be32a84ed0d3f4a8d1197cefac77e0d16046f. --- src/mobile/images/view_menu_bg_disable.png | Bin 0 -> 29898 bytes src/mobile/qml/Main.qml | 1 + src/mobile/qml/NavigationPanel.qml | 1 + src/mobile/qml/PanelToggle.qml | 9 ++++++++- src/mobile/snowshoe-mobile.qrc | 1 + 5 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 src/mobile/images/view_menu_bg_disable.png diff --git a/src/mobile/images/view_menu_bg_disable.png b/src/mobile/images/view_menu_bg_disable.png new file mode 100644 index 0000000..2409f42 Binary files /dev/null and b/src/mobile/images/view_menu_bg_disable.png differ diff --git a/src/mobile/qml/Main.qml b/src/mobile/qml/Main.qml index 2a156b9..0e729cf 100644 --- a/src/mobile/qml/Main.qml +++ b/src/mobile/qml/Main.qml @@ -36,6 +36,7 @@ Rectangle { topMargin: 32 horizontalCenter: parent.horizontalCenter } + navigationEnabled: navigationPanel.hasOpennedTabs onTopSitesSelected: { rootPage.state = "favorites"; } diff --git a/src/mobile/qml/NavigationPanel.qml b/src/mobile/qml/NavigationPanel.qml index e545c75..cf9afa1 100644 --- a/src/mobile/qml/NavigationPanel.qml +++ b/src/mobile/qml/NavigationPanel.qml @@ -22,6 +22,7 @@ import "UiConstants.js" as UiConstants Item { id: navigationPanel + property bool hasOpennedTabs: TabsModel.count > 0 property alias url: navigationBar.url property QtObject visibleTab: TabsModel.currentWebView property QtObject lastVisibleTab diff --git a/src/mobile/qml/PanelToggle.qml b/src/mobile/qml/PanelToggle.qml index f0027a9..92f5606 100644 --- a/src/mobile/qml/PanelToggle.qml +++ b/src/mobile/qml/PanelToggle.qml @@ -19,12 +19,18 @@ import QtQuick 2.0 Image { id: panelToggle + property bool navigationEnabled: true property alias topSitesButtonSelected: topsites.visible signal topSitesSelected() signal tabsSelected() - source: "qrc:///mobile/app/menu_unpressed" + onNavigationEnabledChanged: { + if (!navigationEnabled) + topsites.visible = true; + } + + source: navigationEnabled ? "qrc:///mobile/app/menu_unpressed" : "qrc:///mobile/app/menu_disabled" Image { id: topsites @@ -45,6 +51,7 @@ Image { } MouseArea { anchors.fill: tabs + visible: navigationEnabled onClicked: topsites.visible = false } } diff --git a/src/mobile/snowshoe-mobile.qrc b/src/mobile/snowshoe-mobile.qrc index 9d18697..c0b09f5 100644 --- a/src/mobile/snowshoe-mobile.qrc +++ b/src/mobile/snowshoe-mobile.qrc @@ -25,6 +25,7 @@ images/app_bg.png images/overlayer.png images/view_menu_bg_unpressed.png + images/view_menu_bg_disable.png images/view_menu_tabs_pressed.png images/view_menu_mysites_pressed.png images/pagination_active.png -- cgit v1.2.3