-
-
Notifications
You must be signed in to change notification settings - Fork 240
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5415 from opengisch/qmlformat-pre-commit
qmlformat --reformat-codebase
- Loading branch information
Showing
109 changed files
with
10,280 additions
and
10,793 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 | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
[General] | ||
IndentWidth=2 | ||
NewlineType=native | ||
NormalizeOrder= | ||
UseTabs= |
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 | Diff line number | Diff line change |
---|---|---|
@@ -1,198 +1,190 @@ | ||
import QtQuick 2.14 | ||
import QtQuick.Controls 2.14 | ||
import QtQuick.Layouts 1.14 | ||
|
||
import Theme 1.0 | ||
import org.qfield 1.0 | ||
|
||
Item { | ||
id: aboutPanel | ||
|
||
Rectangle { | ||
color: "black" | ||
opacity: 0.8 | ||
id: aboutPanel | ||
|
||
Rectangle { | ||
color: "black" | ||
opacity: 0.8 | ||
anchors.fill: parent | ||
} | ||
|
||
ColumnLayout { | ||
id: aboutContainer | ||
spacing: 6 | ||
anchors.fill: parent | ||
anchors.margins: 20 | ||
anchors.topMargin: 20 + mainWindow.sceneTopMargin | ||
anchors.bottomMargin: 20 + mainWindow.sceneBottomMargin | ||
|
||
ScrollView { | ||
Layout.fillWidth: true | ||
Layout.fillHeight: true | ||
ScrollBar.horizontal.policy: ScrollBar.AlwaysOff | ||
ScrollBar.vertical.policy: ScrollBar.AsNeeded | ||
contentItem: information | ||
contentWidth: information.width | ||
contentHeight: information.height | ||
clip: true | ||
|
||
MouseArea { | ||
anchors.fill: parent | ||
} | ||
onClicked: aboutPanel.visible = false | ||
} | ||
|
||
ColumnLayout { | ||
id: aboutContainer | ||
ColumnLayout { | ||
id: information | ||
spacing: 6 | ||
anchors.fill: parent | ||
anchors.margins: 20 | ||
anchors.topMargin: 20 + mainWindow.sceneTopMargin | ||
anchors.bottomMargin: 20 + mainWindow.sceneBottomMargin | ||
|
||
ScrollView { | ||
Layout.fillWidth: true | ||
Layout.fillHeight: true | ||
ScrollBar.horizontal.policy: ScrollBar.AlwaysOff | ||
ScrollBar.vertical.policy: ScrollBar.AsNeeded | ||
contentItem: information | ||
contentWidth: information.width | ||
contentHeight: information.height | ||
clip: true | ||
|
||
MouseArea { | ||
anchors.fill: parent | ||
onClicked: aboutPanel.visible = false | ||
} | ||
|
||
ColumnLayout { | ||
id: information | ||
spacing: 6 | ||
width: aboutPanel.width - 40 | ||
height: Math.max(mainWindow.height - linksButton.height * 2 - qfieldAppDirectoryLabel.height - aboutContainer.spacing * 3 - aboutContainer.anchors.topMargin - aboutContainer.anchors.bottomMargin, | ||
qfieldPart.height + opengisPart.height + spacing) | ||
|
||
ColumnLayout { | ||
id: qfieldPart | ||
Layout.fillHeight: true | ||
Layout.alignment: Qt.AlignHCenter | ||
|
||
MouseArea { | ||
Layout.preferredWidth: 138 | ||
Layout.preferredHeight: 138 | ||
Image { | ||
id: qfieldLogo | ||
width: parent.width | ||
height: parent.height | ||
source: "qrc:/images/qfield_logo.svg" | ||
sourceSize.width: width * screen.devicePixelRatio | ||
sourceSize.height: height * screen.devicePixelRatio | ||
} | ||
onClicked: Qt.openUrlExternally("https://qfield.org/") | ||
} | ||
|
||
Label { | ||
Layout.fillWidth: true | ||
Layout.maximumWidth: parent.width | ||
Layout.alignment: Qt.AlignCenter | ||
horizontalAlignment: Text.AlignHCenter | ||
font: Theme.strongFont | ||
color: Theme.light | ||
textFormat: Text.RichText | ||
text: { | ||
var links = '<a href="https://github.com/opengisch/QField/commit/' + gitRev + '">' + gitRev.substr(0, 6) + '</a>' | ||
|
||
if (appVersion && appVersion !== '1.0.0') | ||
links += ' <a href="https://github.com/opengisch/QField/releases/tag/' + appVersion + '">' + appVersion + '</a>' | ||
|
||
return "QField<br>" + appVersionStr + " (" + links + ")<br>Qt " + qVersion | ||
} | ||
onLinkActivated: Qt.openUrlExternally(link) | ||
} | ||
} | ||
|
||
ColumnLayout { | ||
id: opengisPart | ||
Layout.fillHeight: true | ||
Layout.alignment: Qt.AlignHCenter | ||
|
||
MouseArea { | ||
Layout.preferredWidth: 91 | ||
Layout.preferredHeight:113 | ||
Image { | ||
id: opengisLogo | ||
width: parent.width | ||
height: parent.height | ||
source: "qrc:/images/opengis-logo.svg" | ||
sourceSize.width: width * screen.devicePixelRatio | ||
sourceSize.height: height * screen.devicePixelRatio | ||
} | ||
onClicked: Qt.openUrlExternally("https://opengis.ch") | ||
} | ||
|
||
Label { | ||
Layout.fillWidth: true | ||
Layout.maximumWidth: parent.width | ||
Layout.alignment: Qt.AlignCenter | ||
horizontalAlignment: Text.AlignHCenter | ||
font: Theme.strongFont | ||
color: Theme.light | ||
textFormat: Text.RichText | ||
text: qsTr( "Developed by" ) + '<br><a href="https://opengis.ch">OPENGIS.ch</a>' | ||
onLinkActivated: Qt.openUrlExternally(link) | ||
} | ||
} | ||
width: aboutPanel.width - 40 | ||
height: Math.max(mainWindow.height - linksButton.height * 2 - qfieldAppDirectoryLabel.height - aboutContainer.spacing * 3 - aboutContainer.anchors.topMargin - aboutContainer.anchors.bottomMargin, qfieldPart.height + opengisPart.height + spacing) | ||
|
||
ColumnLayout { | ||
id: qfieldPart | ||
Layout.fillHeight: true | ||
Layout.alignment: Qt.AlignHCenter | ||
|
||
MouseArea { | ||
Layout.preferredWidth: 138 | ||
Layout.preferredHeight: 138 | ||
Image { | ||
id: qfieldLogo | ||
width: parent.width | ||
height: parent.height | ||
source: "qrc:/images/qfield_logo.svg" | ||
sourceSize.width: width * screen.devicePixelRatio | ||
sourceSize.height: height * screen.devicePixelRatio | ||
} | ||
} | ||
onClicked: Qt.openUrlExternally("https://qfield.org/") | ||
} | ||
|
||
Label { | ||
id: qfieldAppDirectoryLabel | ||
Label { | ||
Layout.fillWidth: true | ||
Layout.maximumWidth: parent.width | ||
Layout.alignment: Qt.AlignCenter | ||
horizontalAlignment: Text.AlignHCenter | ||
font: Theme.tinyFont | ||
font: Theme.strongFont | ||
color: Theme.light | ||
opacity: 0.6 | ||
|
||
textFormat: Text.RichText | ||
text: { | ||
var dataDirs = platformUtilities.appDataDirs(); | ||
if (dataDirs.length > 0) { | ||
return (dataDirs.length > 1 | ||
? 'QField app directories' | ||
: 'QField app directory') | ||
+ '\n' + dataDirs.join('\n'); | ||
} | ||
return ''; | ||
var links = '<a href="https://github.com/opengisch/QField/commit/' + gitRev + '">' + gitRev.substr(0, 6) + '</a>'; | ||
if (appVersion && appVersion !== '1.0.0') | ||
links += ' <a href="https://github.com/opengisch/QField/releases/tag/' + appVersion + '">' + appVersion + '</a>'; | ||
return "QField<br>" + appVersionStr + " (" + links + ")<br>Qt " + qVersion; | ||
} | ||
onLinkActivated: Qt.openUrlExternally(link) | ||
} | ||
} | ||
|
||
QfButton { | ||
id: sponsorshipButton | ||
ColumnLayout { | ||
id: opengisPart | ||
Layout.fillHeight: true | ||
Layout.alignment: Qt.AlignHCenter | ||
|
||
MouseArea { | ||
Layout.preferredWidth: 91 | ||
Layout.preferredHeight: 113 | ||
Image { | ||
id: opengisLogo | ||
width: parent.width | ||
height: parent.height | ||
source: "qrc:/images/opengis-logo.svg" | ||
sourceSize.width: width * screen.devicePixelRatio | ||
sourceSize.height: height * screen.devicePixelRatio | ||
} | ||
onClicked: Qt.openUrlExternally("https://opengis.ch") | ||
} | ||
|
||
Label { | ||
Layout.fillWidth: true | ||
icon.source: Theme.getThemeVectorIcon( 'ic_sponsor_white_24dp' ) | ||
Layout.maximumWidth: parent.width | ||
Layout.alignment: Qt.AlignCenter | ||
horizontalAlignment: Text.AlignHCenter | ||
font: Theme.strongFont | ||
color: Theme.light | ||
textFormat: Text.RichText | ||
text: qsTr("Developed by") + '<br><a href="https://opengis.ch">OPENGIS.ch</a>' | ||
onLinkActivated: Qt.openUrlExternally(link) | ||
} | ||
} | ||
} | ||
} | ||
|
||
text: qsTr( 'Support QField') | ||
onClicked: Qt.openUrlExternally("https://github.com/sponsors/opengisch") | ||
Label { | ||
id: qfieldAppDirectoryLabel | ||
Layout.fillWidth: true | ||
Layout.maximumWidth: parent.width | ||
Layout.alignment: Qt.AlignCenter | ||
horizontalAlignment: Text.AlignHCenter | ||
font: Theme.tinyFont | ||
color: Theme.light | ||
opacity: 0.6 | ||
|
||
text: { | ||
var dataDirs = platformUtilities.appDataDirs(); | ||
if (dataDirs.length > 0) { | ||
return (dataDirs.length > 1 ? 'QField app directories' : 'QField app directory') + '\n' + dataDirs.join('\n'); | ||
} | ||
return ''; | ||
} | ||
} | ||
|
||
QfButton { | ||
id: linksButton | ||
dropdown: true | ||
Layout.fillWidth: true | ||
icon.source: Theme.getThemeVectorIcon( 'ic_book_white_24dp' ) | ||
QfButton { | ||
id: sponsorshipButton | ||
Layout.fillWidth: true | ||
icon.source: Theme.getThemeVectorIcon('ic_sponsor_white_24dp') | ||
|
||
text: qsTr( 'Documentation' ) | ||
text: qsTr('Support QField') | ||
onClicked: Qt.openUrlExternally("https://github.com/sponsors/opengisch") | ||
} | ||
|
||
QfButton { | ||
id: linksButton | ||
dropdown: true | ||
Layout.fillWidth: true | ||
icon.source: Theme.getThemeVectorIcon('ic_book_white_24dp') | ||
|
||
onClicked: { | ||
Qt.openUrlExternally("https://docs.qfield.org/") | ||
} | ||
text: qsTr('Documentation') | ||
|
||
onDropdownClicked: { | ||
linksMenu.popup(linksButton.width - linksMenu.width + 10, linksButton.y + 10) | ||
} | ||
} | ||
} | ||
onClicked: { | ||
Qt.openUrlExternally("https://docs.qfield.org/"); | ||
} | ||
|
||
Menu { | ||
id: linksMenu | ||
title: qsTr( "Links Menu" ) | ||
|
||
width: { | ||
var result = 0; | ||
var padding = 0; | ||
for (var i = 0; i < count; ++i) { | ||
var item = itemAt(i); | ||
result = Math.max(item.contentItem.implicitWidth, result); | ||
padding = Math.max(item.padding, padding); | ||
} | ||
return result + padding * 2; | ||
} | ||
onDropdownClicked: { | ||
linksMenu.popup(linksButton.width - linksMenu.width + 10, linksButton.y + 10); | ||
} | ||
} | ||
} | ||
|
||
Menu { | ||
id: linksMenu | ||
title: qsTr("Links Menu") | ||
|
||
width: { | ||
var result = 0; | ||
var padding = 0; | ||
for (var i = 0; i < count; ++i) { | ||
var item = itemAt(i); | ||
result = Math.max(item.contentItem.implicitWidth, result); | ||
padding = Math.max(item.padding, padding); | ||
} | ||
return result + padding * 2; | ||
} | ||
|
||
MenuItem { | ||
text: qsTr('Changelog') | ||
MenuItem { | ||
text: qsTr('Changelog') | ||
|
||
font: Theme.defaultFont | ||
height: 48 | ||
leftPadding: Theme.menuItemLeftPadding | ||
icon.source: Theme.getThemeVectorIcon( 'ic_speaker_white_24dp' ) | ||
font: Theme.defaultFont | ||
height: 48 | ||
leftPadding: Theme.menuItemLeftPadding | ||
icon.source: Theme.getThemeVectorIcon('ic_speaker_white_24dp') | ||
|
||
onTriggered: { | ||
changelogPopup.open() | ||
} | ||
} | ||
onTriggered: { | ||
changelogPopup.open(); | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.