Changeset 14edc57
- Timestamp:
- 03/10/12 22:05:38 (16 months ago)
- Branches:
- master
- Children:
- 2ed195c
- Parents:
- 2706b4b
- git-author:
- xkolman2 <xkolman2@…> (03/10/12 22:05:38)
- git-committer:
- xkolman2 <xkolman2@…> (03/10/12 22:05:38)
- Location:
- modules/gui_modules/gui_qml/qml
- Files:
-
- 5 edited
-
IconGridButton.qml (modified) (4 diffs)
-
IconGridPage.qml (modified) (4 diffs)
-
MapPage.qml (modified) (1 diff)
-
MenuPage.qml (modified) (1 diff)
-
main.qml (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
modules/gui_modules/gui_qml/qml/IconGridButton.qml
r10fb212 r14edc57 8 8 property alias iconName : themedIcon.iconName 9 9 property alias color : background.color 10 property alias sensitive : mouseArea.enabled 10 11 property string text : "" 11 12 signal clicked 13 14 scale : mouseArea.pressed ? 0.9 : 1.0 15 //transform: Scale { origin.x: 25; origin.y: 25; xScale: 3} 12 16 13 17 width : iconSize … … 21 25 height : icgb.iconSize-icgb.margin/2.0 22 26 // TODO: get color from theme 23 //color : icgb.clicked ? "black" : "#92aaf3"27 //color : mouseArea.pressed ? "black" : "#92aaf3" 24 28 color : "#92aaf3" 25 29 radius : 10 … … 30 34 id: themedIcon 31 35 anchors.horizontalCenter : parent.horizontalCenter 36 anchors.top : parent.top 37 anchors.bottom : iconLabel.top 38 anchors.right : parent.right 39 anchors.left : parent.left 32 40 iconName : icon 33 41 anchors.margins : icgb.margin … … 35 43 height : parent.height-icgb.margin 36 44 } 37 } 38 // caption 39 Label { 40 text : icgb.text 41 anchors.horizontalCenter : parent.horizontalCenter 42 anchors.bottom : parent.bottom 43 anchors.bottomMargin : icgb.margin/1.5 45 // caption 46 Label { 47 id : iconLabel 48 text : icgb.text 49 font.pixelSize : rWin.inPortrait ? 42 : 36 50 anchors.horizontalCenter : parent.horizontalCenter 51 anchors.bottom : parent.bottom 52 anchors.bottomMargin : icgb.margin/1.5 53 } 44 54 } 45 55 MouseArea { -
modules/gui_modules/gui_qml/qml/IconGridPage.qml
r10fb212 r14edc57 3 3 4 4 Page { 5 property alias model : gridView.model 6 5 7 id : iconGP 6 8 property double iconMargin : width/20.0 … … 15 17 } 16 18 17 18 ListModel {19 id : testModel20 21 ListElement {22 caption : "back"23 icon : "left_arrow_black.png"24 menu : ""25 }26 27 ListElement {28 caption : "search"29 icon : "search.png"30 menu : ""31 }32 ListElement {33 caption : "routes"34 icon : "route.png"35 menu : ""36 }37 ListElement {38 caption : "POI"39 icon : "poi.png"40 menu : ""41 }42 ListElement {43 caption : "info"44 icon : "info.png"45 menu : ""46 }47 ListElement {48 caption : "mode"49 icon : "mode.png"50 menu : ""51 }52 ListElement {53 caption : "options"54 icon : "options.png"55 menu : ""56 }57 }58 59 19 // main flickable with icon grid 60 20 GridView { 21 id : gridView 61 22 anchors.fill : parent 62 23 anchors.topMargin : iconGP.iconMargin/4.0 … … 65 26 cellWidth : iconGP.iconSize 66 27 67 model : testModel 28 // default empty list model 29 model : ListModel { 30 } 31 32 68 33 delegate : IconGridButton { 69 34 //anchors.fill : parent … … 74 39 iconSize : iconGP.iconSize 75 40 margin : iconGP.iconMargin 41 onClicked : { 42 console.log("clicked") 43 console.log(caption) 44 rWin.pageStack.push(rWin.getPage(menu)) 45 } 76 46 } 77 Component.onCompleted: console.log("AASDASDASDASDASDASD") 78 //Component.onCompleted: console.log("icon grid " + model) 47 //insert the back arrow 48 Component.onCompleted: { 49 console.log("INSERTING BACK ARROW") 50 model.insert(0, {"caption": "back", "icon":"left_arrow_black.png", "menu":""}) 51 } 79 52 80 53 -
modules/gui_modules/gui_qml/qml/MapPage.qml
rc5f8db1 r14edc57 177 177 } 178 178 Button { 179 id: refreshGeocachesButton179 id: mainMenuButton 180 180 iconSource: "image://theme/icon-m-content-application" + (theme.inverted ? "-inverse" : "") 181 181 width: parent.parent.buttonSize -
modules/gui_modules/gui_qml/qml/MenuPage.qml
r38a721a r14edc57 3 3 4 4 IconGridPage { 5 model : ListModel { 6 id : testModel 7 ListElement { 8 caption : "search" 9 icon : "search.png" 10 menu : "" 11 } 12 ListElement { 13 caption : "routes" 14 icon : "route.png" 15 menu : "" 16 } 17 ListElement { 18 caption : "POI" 19 icon : "poi.png" 20 menu : "" 21 } 22 ListElement { 23 caption : "info" 24 icon : "info.png" 25 menu : "" 26 } 27 ListElement { 28 caption : "mode" 29 icon : "mode.png" 30 menu : "" 31 } 32 ListElement { 33 caption : "options" 34 icon : "options.png" 35 menu : "optionsMenu" 36 } 37 } 5 38 } -
modules/gui_modules/gui_qml/qml/main.qml
re6683d6 r14edc57 14 14 id : mainMenu 15 15 } 16 OptionsMenuPage { 17 id : optionsMenu 18 } 19 20 /* looks like object ids can't be stored in ListElements, 21 so we need this function to return corresponding menu pages 22 for names given by a string 23 */ 24 25 property variant pages : { 26 "mainMenu" : mainMenu, 27 "optionsMenu" : optionsMenu 28 } 29 30 function getPage(name) { 31 return pages[name] 32 /* TODO: some pages are not so often visited pages so they could 33 be loaded dynamically from their QML files ? 34 -> also, a loader pool might be used as a rudimentary page cache, 35 but this might not be needed if the speed is found to be adequate */ 36 } 16 37 17 38 /** global notification handling **/
Note: See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/trac/gps_navigace/chrome/site/nlp-logo.png)