Launcher: nicer back button.
Avoid localisation issues for the back button, by switching to an icon.
This commit is contained in:
parent
9855e89109
commit
f8aea84541
8 changed files with 40 additions and 16 deletions
BIN
src/GUI/assets/icons8-back-arrow-50.png
Normal file
BIN
src/GUI/assets/icons8-back-arrow-50.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.3 KiB |
|
@ -173,11 +173,9 @@ Rectangle {
|
||||||
text: " "
|
text: " "
|
||||||
}
|
}
|
||||||
|
|
||||||
Button
|
BackButton
|
||||||
{
|
{
|
||||||
width: Style.strutSize
|
|
||||||
id: backButton
|
id: backButton
|
||||||
text: "< Back"
|
|
||||||
onClicked: root.goBack();
|
onClicked: root.goBack();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -38,9 +38,14 @@ Rectangle {
|
||||||
spacing: Style.margin
|
spacing: Style.margin
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
|
|
||||||
|
Item { // top padding
|
||||||
|
width: parent.width
|
||||||
|
height: Style.margin
|
||||||
|
}
|
||||||
|
|
||||||
AircraftVariantChoice {
|
AircraftVariantChoice {
|
||||||
id: headingBox
|
id: headingBox
|
||||||
fontPixelSize: 30
|
fontPixelSize: Style.headingFontPixelSize * 2
|
||||||
popupFontPixelSize: Style.headingFontPixelSize
|
popupFontPixelSize: Style.headingFontPixelSize
|
||||||
|
|
||||||
anchors {
|
anchors {
|
||||||
|
|
|
@ -352,11 +352,9 @@ FocusScope
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
visible: false
|
visible: false
|
||||||
|
|
||||||
Button {
|
BackButton {
|
||||||
anchors { left: parent.left; top: parent.top; margins: Style.margin }
|
|
||||||
width: Style.strutSize
|
|
||||||
id: backButton
|
id: backButton
|
||||||
text: "< Back"
|
anchors { left: parent.left; top: parent.top; margins: Style.margin }
|
||||||
onClicked: root.goBack();
|
onClicked: root.goBack();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
27
src/GUI/qml/BackButton.qml
Normal file
27
src/GUI/qml/BackButton.qml
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
import QtQuick 2.4
|
||||||
|
import "."
|
||||||
|
|
||||||
|
Item {
|
||||||
|
id: root
|
||||||
|
signal clicked
|
||||||
|
property bool enabled: true
|
||||||
|
|
||||||
|
width: image.width + Style.margin
|
||||||
|
height: image.height + Style.margin
|
||||||
|
|
||||||
|
Image {
|
||||||
|
id: image
|
||||||
|
anchors.centerIn: parent
|
||||||
|
source: "qrc:///back-icon"
|
||||||
|
}
|
||||||
|
|
||||||
|
MouseArea {
|
||||||
|
id: mouse
|
||||||
|
hoverEnabled: true
|
||||||
|
anchors.fill: parent
|
||||||
|
|
||||||
|
onClicked: {
|
||||||
|
root.clicked();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -481,12 +481,10 @@ Item {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Button {
|
BackButton {
|
||||||
id: backButton
|
id: backButton
|
||||||
anchors { left: parent.left; top: parent.top; margins: Style.margin }
|
anchors { left: parent.left; top: parent.top; margins: Style.margin }
|
||||||
width: Style.strutSize
|
|
||||||
visible: detailLoader.visible
|
visible: detailLoader.visible
|
||||||
text: "< Back"
|
|
||||||
onClicked: {
|
onClicked: {
|
||||||
detailLoader.sourceComponent = null
|
detailLoader.sourceComponent = null
|
||||||
}
|
}
|
||||||
|
|
|
@ -323,13 +323,10 @@ Item {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Button {
|
BackButton {
|
||||||
id: backButton
|
id: backButton
|
||||||
|
|
||||||
anchors { left: parent.left; top: parent.top; margins: Style.margin }
|
anchors { left: parent.left; top: parent.top; margins: Style.margin }
|
||||||
width: Style.strutSize
|
|
||||||
visible: detailLoader.visible
|
visible: detailLoader.visible
|
||||||
text: qsTr("< Back")
|
|
||||||
onClicked: root.backToSearch();
|
onClicked: root.backToSearch();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,6 +29,7 @@
|
||||||
<file alias="toolbox-summary">assets/toolbox-summary.png</file>
|
<file alias="toolbox-summary">assets/toolbox-summary.png</file>
|
||||||
<file alias="toolbox-addons">assets/toolbox-addons.png</file>
|
<file alias="toolbox-addons">assets/toolbox-addons.png</file>
|
||||||
<file alias="toolbox-help">assets/toolbox-help.png</file>
|
<file alias="toolbox-help">assets/toolbox-help.png</file>
|
||||||
|
<file alias="back-icon">assets/icons8-back-arrow-50.png</file>
|
||||||
<file>qml/AircraftList.qml</file>
|
<file>qml/AircraftList.qml</file>
|
||||||
<file>qml/AircraftRating.qml</file>
|
<file>qml/AircraftRating.qml</file>
|
||||||
<file>qml/ArrowButton.qml</file>
|
<file>qml/ArrowButton.qml</file>
|
||||||
|
@ -141,7 +142,7 @@
|
||||||
<file>qml/NewVersionNotification.qml</file>
|
<file>qml/NewVersionNotification.qml</file>
|
||||||
<file>qml/DidMigrateOfficialCatalogNotification.qml</file>
|
<file>qml/DidMigrateOfficialCatalogNotification.qml</file>
|
||||||
<file>qml/DidMigrateOtherCatalogNotification.qml</file>
|
<file>qml/DidMigrateOtherCatalogNotification.qml</file>
|
||||||
|
<file>qml/BackButton.qml</file>
|
||||||
</qresource>
|
</qresource>
|
||||||
<qresource prefix="/preview">
|
<qresource prefix="/preview">
|
||||||
<file alias="close-icon">assets/preview-close.png</file>
|
<file alias="close-icon">assets/preview-close.png</file>
|
||||||
|
|
Loading…
Add table
Reference in a new issue