diff options
author | Luciano Wolf <luciano.wolf@openbossa.org> | 2012-06-21 10:53:04 -0300 |
---|---|---|
committer | Luciano Wolf <luciano.wolf@openbossa.org> | 2012-06-25 16:42:21 -0300 |
commit | b6dbf9f5f469707940d84ae81220054faee3a2e7 (patch) | |
tree | f77ab108f0284e079518695935d2436bda4d4a3f | |
parent | 8c77d43611345f7594bbbbab0a18e0ef3c94cc02 (diff) | |
download | snowshoe-b6dbf9f5f469707940d84ae81220054faee3a2e7.tar.gz |
Implementing UI behaviour: start up screen.
Tabs grid should be the default option unless we have some topsite
already added into database.
Reviewed-by: Rafael Brandao
-rw-r--r-- | src/mobile/qml/Main.qml | 11 | ||||
-rw-r--r-- | src/mobile/qml/PanelToggle.qml | 16 |
2 files changed, 22 insertions, 5 deletions
diff --git a/src/mobile/qml/Main.qml b/src/mobile/qml/Main.qml index 5fff69f..03de7f6 100644 --- a/src/mobile/qml/Main.qml +++ b/src/mobile/qml/Main.qml @@ -36,7 +36,8 @@ Rectangle { topMargin: 32 horizontalCenter: parent.horizontalCenter } - navigationEnabled: navigationPanel.hasOpennedTabs + topSitesEnabled: BookmarkModel.count + navigationEnabled: navigationPanel.hasOpennedTabs || !topSitesEnabled || panelToggle.overrideNavigationEnabled onTopSitesSelected: { rootPage.state = "favorites"; } @@ -78,6 +79,7 @@ Rectangle { onWebViewMaximized: { rootPage.state = "navigationFullScreen"; + panelToggle.overrideNavigationEnabled = true; } onWebViewMinimized: { rootPage.state = "navigation"; @@ -162,7 +164,12 @@ Rectangle { // then to true on start up causing a cascade misbehaviour, the workaround // is to set the state of the root element on Component.onCompleted. // state: "favorites" - Component.onCompleted: state = "favorites" + Component.onCompleted: { + if (panelToggle.topSitesEnabled) + state = "favorites"; + else + state = "navigation"; + } states: [ State { diff --git a/src/mobile/qml/PanelToggle.qml b/src/mobile/qml/PanelToggle.qml index 92f5606..64ee23c 100644 --- a/src/mobile/qml/PanelToggle.qml +++ b/src/mobile/qml/PanelToggle.qml @@ -19,18 +19,27 @@ import QtQuick 2.0 Image { id: panelToggle + property bool topSitesEnabled: false property bool navigationEnabled: true + property bool overrideNavigationEnabled: false property alias topSitesButtonSelected: topsites.visible signal topSitesSelected() signal tabsSelected() + onTopSitesEnabledChanged: { + if (!topSitesEnabled) { + tabs.visible = true; + topsites.visible = false; + } + } + onNavigationEnabledChanged: { - if (!navigationEnabled) + if (!navigationEnabled && topSitesEnabled) topsites.visible = true; } - source: navigationEnabled ? "qrc:///mobile/app/menu_unpressed" : "qrc:///mobile/app/menu_disabled" + source: topSitesEnabled && navigationEnabled ? "qrc:///mobile/app/menu_unpressed" : "qrc:///mobile/app/menu_disabled" Image { id: topsites @@ -39,6 +48,7 @@ Image { } MouseArea { anchors.fill: topsites + visible: topSitesEnabled onClicked: topsites.visible = true } @@ -51,7 +61,7 @@ Image { } MouseArea { anchors.fill: tabs - visible: navigationEnabled + visible: navigationEnabled || !topSitesEnabled onClicked: topsites.visible = false } } |