\r
Image {\r
id: imgItem; source: gui.iconPath+container.icon; anchors.top: container.top; anchors.horizontalCenter: container.horizontalCenter;\r
- width: 48; height: 48\r
+ width: gui.height/8; height: gui.height/8\r
}\r
\r
Text {\r
- id: txtItem; text: container.text; anchors.top: imgItem.bottom; anchors.horizontalCenter: container.horizontalCenter; color: "White"; font.pointSize: 18;\r
+ id: txtItem; text: container.text; anchors.top: imgItem.bottom; anchors.horizontalCenter: container.horizontalCenter; \r
+ color: "White"; font.pointSize: gui.height/32; horizontalAlignment: Qt.AlignHCenter\r
}\r
\r
states: [\r
Rectangle {
id: page
- width: 800; height: 424
+ width: gui.width; height: gui.height
border.width: 1
color: "Black"
opacity: 0
NumberAnimation { id: opacityAnimation; duration: 300; alwaysRunToEnd: true }
}
- Text { id: myText; anchors.centerIn: parent; text: "Hi, i'm Navit!"; color: "White" }
+ Text { id: myText; anchors.centerIn: parent; text: "Hi, i'm Navit!"; color: "White"; font.pointSize: gui.height/32 }
Cellar {anchors.bottom: page.bottom; anchors.horizontalCenter: page.horizontalCenter; width: page.width }
}
Rectangle {
id: page
- width: 800; height: 424
+ width: gui.width; height: gui.height
color: "Black"
opacity: 0
Grid {
columns: 3;rows: 1
anchors.horizontalCenter: parent.horizontalCenter;
- anchors.bottom: parent.verticalCenter; anchors.bottomMargin: 48;
- spacing: 64
+ anchors.bottom: parent.verticalCenter; anchors.bottomMargin: ui.height/16;
+ spacing: gui.width/12
ButtonIcon {
id: btnView; text: "View on map"; icon: "gui_maps.svg"; onClicked: console.log("Implement me!");
}
Grid {
columns: 2;rows: 1
anchors.horizontalCenter: parent.horizontalCenter;
- anchors.top: parent.verticalCenter; anchors.topMargin: 48;
- spacing: 64
+ anchors.top: parent.verticalCenter; anchors.topMargin: ui.height/16;
+ spacing: gui.width/12
ButtonIcon {
id: btnQuit; text: "POIs"; icon: "attraction.svg"; onClicked: console.log("Implement me!");
}
Rectangle {\r
id: page\r
\r
- width: 800; height: 424\r
+ width: gui.width; height: gui.height\r
color: "Black"\r
opacity: 0\r
\r
Grid {\r
columns: 3;rows: 1\r
anchors.horizontalCenter: parent.horizontalCenter;\r
- anchors.bottom: parent.verticalCenter; anchors.bottomMargin: 48;\r
- spacing: 64\r
+ anchors.bottom: parent.verticalCenter; anchors.bottomMargin: gui.height/16;\r
+ spacing: gui.width/12\r
ButtonIcon {\r
id: btnBookmarks; text: "Bookmarks"; icon: "gui_bookmark.svg"; onClicked: console.log("Implement me!");\r
}\r
Grid {\r
columns: 2;rows: 1\r
anchors.horizontalCenter: parent.horizontalCenter;\r
- anchors.top: parent.verticalCenter; anchors.topMargin: 48;\r
- spacing: 64\r
+ anchors.top: parent.verticalCenter; anchors.topMargin: gui.height/16;\r
+ spacing: gui.width/12\r
ButtonIcon {\r
id: btnAbout; text: "Search"; icon: "gui_town.svg"; onClicked: console.log("Implement me!");\r
}\r
Rectangle {\r
id: page\r
\r
- width: 800; height: 424\r
+ width: gui.width; height: gui.height\r
border.width: 1\r
color: "Black"\r
opacity: 0\r
Grid {\r
columns: 3;rows: 1\r
anchors.horizontalCenter: parent.horizontalCenter;\r
- anchors.bottom: parent.verticalCenter; anchors.bottomMargin: 48;\r
- spacing: 64\r
+ anchors.bottom: parent.verticalCenter; anchors.bottomMargin: gui.height/16;\r
+ spacing: gui.width/12\r
ButtonIcon {\r
id: btnDisplay; text: "Display"; icon: "gui_display.svg"; onClicked: gui.setPage("PageSettingsDisplay.qml")
}\r
Grid {\r
columns: 2;rows: 1\r
anchors.horizontalCenter: parent.horizontalCenter;\r
- anchors.top: parent.verticalCenter; anchors.topMargin: 48;\r
- spacing: 64\r
+ anchors.top: parent.verticalCenter; anchors.topMargin: gui.height/16;\r
+ spacing: gui.width/12\r
ButtonIcon {\r
id: btnRules; text: "Rules"; icon: "gui_rules.svg"; onClicked: gui.setPage("PageSettingsRules.qml")
}\r
Rectangle {
id: page
- width: 800; height: 424
+ width: gui.width; height: gui.height
border.width: 1
color: "Black"
opacity: 0
NumberAnimation { id: opacityAnimation; duration: 300; alwaysRunToEnd: true }
}
+ ListSelector {
+ id:layoutList; text: "Current layout"; itemId: navit.getAttrList("layout"); onChanged: navit.setObjectByName("layout",layoutList.value)
+ anchors.top: parent.top;
+ anchors.left: parent.left; anchors.leftMargin: 3
+ anchors.topMargin: gui.height/16; anchors.leftMargin: gui.width/32
+ }
Grid {
- columns: 2; rows: 1
- anchors.verticalCenter: parent.verticalCenter;
- anchors.left: parent.left; anchors.right: parent.right;
- ListSelector {
- id:layoutList; text: "Current layout"; itemId: navit.getAttrList("layout"); onChanged: navit.setObjectByName("layout",layoutList.value)
- anchors.left: parent.left
- }
- Grid {
- columns: 1; rows: 3
- anchors.right: parent.right;
- spacing: 64
- ToggleSwitch {
- id: fullscreenSw; on: gui.getAttr("fullscreen"); text: "Fullscreen"; onChanged: gui.setAttr("fullscreen",fullscreenSw.on)
- }
- ToggleSwitch {
- id: tripledSw; on: page.isTripleD(); text: "2D/3D"; onChanged: setTripleD(tripledSw.on)
- }
- Slider {
- id: pitchSlider; minValue: 5; maxValue: 90; value: navit.getAttr("pitch"); text: "Pitch"; onChanged: { navit.setAttr("pitch",pitchSlider.value); gui.setAttr("pitch",pitchSlider.value) }
- opacity: 0
- }
+ columns: 1; rows: 3
+ anchors.right: parent.right
+ anchors.top: parent.top;
+ anchors.topMargin: gui.height/16; anchors.leftMargin: gui.width/32
+ spacing: gui.width/12
+ ToggleSwitch {
+ id: fullscreenSw; on: gui.getAttr("fullscreen"); text: "Fullscreen"; onChanged: gui.setAttr("fullscreen",fullscreenSw.on)
+ }
+ ToggleSwitch {
+ id: tripledSw; on: page.isTripleD(); text: "2D/3D"; onChanged: setTripleD(tripledSw.on)
}
+ Slider {
+ id: pitchSlider; minValue: 5; maxValue: 90; value: navit.getAttr("pitch"); text: "Pitch"; onChanged: { navit.setAttr("pitch",pitchSlider.value); gui.setAttr("pitch",pitchSlider.value) }
+ opacity: 0
+ }
}
Cellar {anchors.bottom: page.bottom; anchors.horizontalCenter: page.horizontalCenter; width: page.width }
Rectangle {
id: page
- width: 800; height: 424
+ width: gui.width; height: gui.height
border.width: 1
color: "Black"
opacity: 0
anchors.horizontalCenter: parent.horizontalCenter;
anchors.verticalCenter: parent.verticalCenter;
- Text { id: lang; anchors.bottom: langname.top; text: gui.localeName; color: "White" }
- Text { id: langname; anchors.centerIn: parent; text: gui.langName; color: "White" }
- Text { id: ctryname; anchors.top: langname.bottom; text: gui.ctryName; color: "White" }
+ Text { id: lang; anchors.bottom: langname.top; text: gui.localeName; color: "White";font.pointSize: gui.height/24 }
+ Text { id: langname; anchors.centerIn: parent; text: gui.langName; color: "White";font.pointSize: gui.height/24 }
+ Text { id: ctryname; anchors.top: langname.bottom; text: gui.ctryName; color: "White";font.pointSize: gui.height/24 }
}
Cellar {anchors.bottom: page.bottom; anchors.horizontalCenter: page.horizontalCenter; width: page.width }
Rectangle {\r
id: page\r
\r
- width: 800; height: 424\r
+ width: gui.width; height: gui.height\r
border.width: 1\r
color: "Black"\r
opacity: 0\r
columns: 1; rows: 3\r
anchors.horizontalCenter: parent.horizontalCenter;\r
anchors.verticalCenter: parent.verticalCenter;\r
- spacing: 64\r
+ spacing: gui.width/12\r
ToggleSwitch {\r
id: trackingSw; on: navit.getAttr("tracking"); text: "Lock on road"; onChanged: navit.setAttr("tracking",trackingSw.on)\r
}\r
Rectangle {
id: page
- width: 800; height: 424
+ width: gui.width; height: gui.height
border.width: 1
color: "Black"
opacity: 0
columns: 1;rows: 1
anchors.horizontalCenter: parent.horizontalCenter;
anchors.verticalCenter: parent.verticalCenter;
- spacing: 64
ButtonIcon {
id: btnDisplay; text: "Locale"; icon: "gui_actions.svg"; onClicked: gui.setPage("PageSettingsLocale.qml")
}
Rectangle {
id: page
- width: 800; height: 424
+ width: gui.width; height: gui.height
border.width: 1
color: "Black"
opacity: 0
ListSelector {
id:vehicleList; text: "Current vehicle profile"; itemId: navit.getAttrList("vehicle"); onChanged: {navit.setObjectByName("vehicle",vehicleList.value) }
- anchors.top: parent.top; anchors.topMargin: 48
- anchors.horizontalCenter: parent.horizontalCenter;
+ anchors.top: parent.top; anchors.topMargin: gui.height/16; anchors.leftMargin: gui.width/32
+ anchors.left: parent.left;
}
ButtonIcon {
id: btnVehicle; text: "Vehicle options"; icon: "gui_vehicle.svg"; onClicked: gui.setPage("PageSettingsVehicleOptions.qml")
- anchors.top: vehicleList.bottom; anchors.topMargin: 48
- anchors.right: page.horizontalCenter;
+ anchors.verticalCenter: vehicleList.verticalCenter; anchors.leftMargin: gui.width/32
+ anchors.left: vehicleList.horizontalCenter;
}
Cellar {anchors.bottom: page.bottom; anchors.horizontalCenter: page.horizontalCenter; width: page.width }
Rectangle {
id: slider
- width: background.width + label.width + 40; height: label.height
+ width: background.width + label.width + gui.width/24; height: label.height
color: "Black"
property int minValue: 0
signal changed
function toSlider(inputVal) {
- return 2+(((inputVal-minValue)/(maxValue-minValue))*126);
+ return 2+(((inputVal-minValue)/(maxValue-minValue))*(background.width-knob.width-2));
}
function fromSlider(inputVal) {
- return minValue+(((inputVal-2)/(126))*(maxValue-minValue));
+ return minValue+(((inputVal-2)/(background.width-knob.width-2))*(maxValue-minValue));
}
function startup () {
Rectangle {
id: background
- x: 20; width: 160; height: 16
+ x: 20; width: gui.width/5; height: gui.height/24
gradient: Gradient {
GradientStop { position: 0.0; color: "steelblue" }
GradientStop { position: 1.0; color: "lightsteelblue" }
radius: 8; opacity: 0.7
Rectangle {
id: knob
- x: 2; y: 2; width: 30; height: 12
+ x: 2; y: 2; width: gui.width/26; height: gui.height/35
radius: 6
gradient: Gradient {
GradientStop { position: 0.0; color: "lightgray" }
}
MouseRegion {
anchors.fill: parent
- drag.target: parent; drag.axis: "XAxis"; drag.minimumX: 2; drag.maximumX: 128
+ drag.target: parent; drag.axis: "XAxis"; drag.minimumX: 2; drag.maximumX: background.width-knob.width
onPositionChanged: slider.value=Math.round(fromSlider(knob.x))
onReleased: slider.changed()
}
}
Text {
- id: valueTxt; text: slider.value; color: "White"; font.pointSize: 14;
+ id: valueTxt; text: slider.value; color: "White"; font.pointSize: gui.height/32;
anchors.horizontalCenter: knob.horizontalCenter;
anchors.verticalCenter: knob.verticalCenter
}
Text {
- id: label; text: slider.text; color: "White"; font.pointSize: 18;
- anchors.left: background.right; anchors.leftMargin: 32;
+ id: label; text: slider.text; color: "White"; font.pointSize: gui.height/24;
+ anchors.left: background.right; anchors.leftMargin: gui.width/24;
anchors.verticalCenter: background.verticalCenter
}
}
\r
Item {\r
id: toggleswitch\r
- width: background.width + label.width + 40; height: background.height\r
+ width: background.width + label.width + gui.width/24; height: background.height\r
\r
property string on: "false"\r
property string text: "Toggle switch"\r
\r
Text {\r
id: label; text: toggleswitch.text; color: "White"; font.pointSize: gui.height/32;\r
- anchors.left: background.right; anchors.leftMargin: gui.width/12;\r
+ anchors.left: background.right; anchors.leftMargin: gui.width/24;\r
anchors.verticalCenter: background.verticalCenter\r
}\r
\r
Rectangle {\r
id: page\r
\r
- width: 800; height: 424\r
+ width: gui.width; height: gui.height\r
color: "Black"\r
opacity: 0\r
\r
Grid {\r
columns: 3;rows: 1\r
anchors.horizontalCenter: parent.horizontalCenter;\r
- anchors.bottom: parent.verticalCenter; anchors.bottomMargin: 48;\r
- spacing: 64\r
+ anchors.bottom: parent.verticalCenter; anchors.bottomMargin: gui.height/16;\r
+ spacing: gui.width/12\r
ButtonIcon {\r
id: btnRoute; text: "Route"; icon: "cursor.svg"; onClicked: gui.setPage("PageRoute.qml")\r
}\r
Grid {\r
columns: 2;rows: 1\r
anchors.horizontalCenter: parent.horizontalCenter;\r
- anchors.top: parent.verticalCenter; anchors.topMargin: 48;\r
- spacing: 64\r
+ anchors.top: parent.verticalCenter; anchors.topMargin: gui.height/16;\r
+ spacing: gui.width/12\r
ButtonIcon {\r
id: btnAbout; text: "About"; icon: "gui_about.svg"; onClicked: gui.setPage("PageAbout.qml") \r
}\r
Rectangle {
id: page
- width: 800; height: 424
+ width: gui.width; height: gui.height
color: "Black"
opacity: 0
Text {
id: infoTxt;
- text: point.coordString; color: "White"; font.pointSize: 20;
+ text: point.coordString; color: "White"; font.pointSize: gui.height/20;
anchors.top:parent.top;anchors.horizontalCenter:parent.horizontalCenter
}
Text {
id: nameTxt;
- text: point.pointName; color: "White"; font.pointSize: 20;
+ text: point.pointName; color: "White"; font.pointSize: gui.height/20;
anchors.top:infoTxt.bottom;anchors.topMargin: 5;anchors.horizontalCenter:parent.horizontalCenter
}
Grid {
columns: 3;rows: 1
anchors.horizontalCenter: parent.horizontalCenter;
- anchors.bottom: parent.verticalCenter; anchors.bottomMargin: 48;
- spacing: 64
+ anchors.bottom: parent.verticalCenter; anchors.bottomMargin: gui.height/16;
+ spacing: gui.width/12
ButtonIcon {
id: btnView; text: "View on map"; icon: "gui_maps.svg"; onClicked: console.log("Implement me!");
}
ButtonIcon {
- id: btnRoadbook; text: "Set as position"; icon: "gui_active.svg"; onClicked: { navit.setPosition(); gui.backToMap() }
+ id: btnRoadbook; text: "Set as\nposition"; icon: "gui_active.svg"; onClicked: { navit.setPosition(); gui.backToMap() }
}
ButtonIcon {
- id: btnSettings; text: "Set as destination"; icon: "gui_active.svg"; onClicked: { navit.setDestination(); gui.backToMap() }
+ id: btnSettings; text: "Set as\ndestination"; icon: "gui_active.svg"; onClicked: { navit.setDestination(); gui.backToMap() }
}
}
Grid {
columns: 3;rows: 1
anchors.horizontalCenter: parent.horizontalCenter;
- anchors.top: parent.verticalCenter; anchors.topMargin: 48;
- spacing: 64
+ anchors.top: parent.verticalCenter; anchors.topMargin: gui.height/16;
+ spacing: gui.width/12
ButtonIcon {
- id: btnQuit; text: "Nearest POIs"; icon: "attraction.svg"; onClicked: console.log("Implement me!");
+ id: btnQuit; text: "Nearest\nPOIs"; icon: "attraction.svg"; onClicked: console.log("Implement me!");
}
ButtonIcon {
- id: btnStop; text: "Add as a Bookmark"; icon: "gui_bookmark.svg"; onClicked: console.log("Implement me!");
+ id: btnStop; text: "Add as\na Bookmark"; icon: "gui_bookmark.svg"; onClicked: console.log("Implement me!");
}
ButtonIcon {
- id: btnInfo; text: "Point information"; icon: "gui_menu.svg"; onClicked: console.log("Implement me!");
+ id: btnInfo; text: "Point\ninformation"; icon: "gui_menu.svg"; onClicked: console.log("Implement me!");
}
}