Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create a menu solution for both v-play and SFOS
This commit provides the BVApp concept of a NavigationMenu, which can be assigned to an ApplicationWindow. It includes the notion of an initialMenuItem, which is ignored on Sailfish, as this item corresponds to the initialPage, which we do not want to have in the pulley menu again as an item. The initialPage in turn is ignored on v-play. Currently you have to set both values (initialMenuItem, initialPage) manually unfortunately. It should be possible to even generalize this. But it is unclear how far we actually want to take the menu abstraction anyway (or in which direction we want it to move, just consider toggleable menu items for list view and map view, for example). So we leave it like this atm. Even v-play went with a "hacked" (i.e. non declarative, but imperative) solution for the menu of their QtWorldSummit2016 app, when they wanted to do something more sophisticated then the standard NavigationMenu behavior: https://github.com/V-Play/QtWorldSummit2016-V-Play/blob/master/qml/QtWSMainItem.qml#L402 > if(Theme.isAndroid) { > navigation.addNavigationItem(tracksNavItemComponent) > navigation.addNavigationItem(venueNavItemComponent) > ... This commit also turns every menuItem on v-play automatically into an NavigationStack (for consitency with the typical stack based navigation common on Sailfish). BTW: The About page is still in rough state on we-pay ;) // Github issue #67
- Loading branch information
Showing
25 changed files
with
116 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,6 @@ | |||
import QtQuick 2.7 | |||
import VPlayApps 1.0 | |||
|
|||
AppButton { | |||
|
|||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,9 +1,8 @@ | |||
import VPlayApps 1.0 | import VPlayApps 1.0 | ||
|
|
||
ListPage { | ListPage { | ||
property var pageStack: navigationStack | |||
|
|
||
//% "Berlin-Vegan" | //% "Berlin-Vegan" | ||
title: qsTrId("id-berlin-vegan") | title: qsTrId("id-berlin-vegan") | ||
|
|||
} | } | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,9 @@ | |||
import Sailfish.Silica 1.0 as Silica | |||
import QtQuick 2.0 | |||
|
|||
Silica.MenuItem { | |||
property var pageToVisit | |||
property var icon | |||
|
|||
onClicked: pageStack.push(pageToVisit) | |||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,7 @@ | |||
import Sailfish.Silica 1.0 as Silica | |||
import QtQuick 2.2 | |||
|
|||
Silica.PullDownMenu { | |||
property var initialMenuItem | |||
} | |||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,3 +1,5 @@ | |||
module BerlinVegan.components | module BerlinVegan.components | ||
IconButton 1.0 IconButton.qml | IconButton 1.0 IconButton.qml | ||
singleton Theme 1.0 Theme.qml | singleton Theme 1.0 Theme.qml | ||
NavigationMenu 1.0 NavigationMenu.qml | |||
MenuItem 1.0 MenuItem.qml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,11 @@ | |||
import QtQuick 2.7 | |||
import VPlayApps 1.0 | |||
|
|||
NavigationItem { | |||
id: item | |||
property var pageToVisit | |||
property alias text: item.title | |||
NavigationStack { | |||
initialPage: pageToVisit | |||
} | |||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,16 @@ | |||
import QtQuick 2.7 | |||
import VPlayApps 1.0 | |||
|
|||
Navigation { | |||
property var initialMenuItem | |||
property var flickable | |||
|
|||
Component.onCompleted: { | |||
var initObj = | |||
insertNavigationItem(0, Qt.createComponent("MenuItem.qml")) | |||
initObj.icon = initialMenuItem.icon | |||
initObj.pageToVisit = initialMenuItem.pageToVisit | |||
initObj.text = initialMenuItem.text | |||
currentIndex = 0 | |||
} | |||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,3 +1,5 @@ | |||
module BerlinVegan.components | module BerlinVegan.components | ||
IconButton 1.0 IconButton.qml | IconButton 1.0 IconButton.qml | ||
singleton Theme 1.0 Theme.qml | singleton Theme 1.0 Theme.qml | ||
NavigationMenu 1.0 NavigationMenu.qml | |||
MenuItem 1.0 MenuItem.qml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters