diff --git a/qml/ApkImportHelper.qml b/qml/ApkImportHelper.qml index aebb8d6..191c105 100644 --- a/qml/ApkImportHelper.qml +++ b/qml/ApkImportHelper.qml @@ -1,4 +1,4 @@ -import QtQuick 2.4 +import QtQuick 2.9 import QtQuick.Layouts 1.2 import QtQuick.Window 2.2 diff --git a/qml/ApkImportWindow.qml b/qml/ApkImportWindow.qml index a04b142..7e227ac 100644 --- a/qml/ApkImportWindow.qml +++ b/qml/ApkImportWindow.qml @@ -1,4 +1,4 @@ -import QtQuick 2.4 +import QtQuick 2.9 import QtQuick.Layouts 1.2 import QtQuick.Window 2.2 diff --git a/qml/EditProfileWindow.qml b/qml/EditProfileWindow.qml index 20a814c..db4dd1b 100644 --- a/qml/EditProfileWindow.qml +++ b/qml/EditProfileWindow.qml @@ -1,4 +1,4 @@ -import QtQuick 2.4 +import QtQuick 2.9 import QtQuick.Layouts 1.2 import QtQuick.Window 2.2 @@ -75,7 +75,7 @@ Window { property var extraVersionName: null property var hideLatest: googleLoginHelper.hideLatest property var data: [] - property var update: () => { + property var update: function() { data = [] versionsmodel.clear() var abis = googleLoginHelper.getAbis(launcherSettings.showUnsupported) diff --git a/qml/GameLogWindow.qml b/qml/GameLogWindow.qml index 8ade063..2091d4d 100644 --- a/qml/GameLogWindow.qml +++ b/qml/GameLogWindow.qml @@ -1,4 +1,4 @@ -import QtQuick 2.4 +import QtQuick 2.9 import QtQuick.Controls 2.2 import QtQuick.Layouts 1.2 diff --git a/qml/GamepadInputField.qml b/qml/GamepadInputField.qml index a327be6..d82ec2a 100644 --- a/qml/GamepadInputField.qml +++ b/qml/GamepadInputField.qml @@ -1,4 +1,4 @@ -import QtQuick 2.4 +import QtQuick 2.9 import QtQuick.Controls 2.2 import QtQuick.Layouts 1.2 diff --git a/qml/GampadTool.qml b/qml/GampadTool.qml index bc34dc6..937ee18 100644 --- a/qml/GampadTool.qml +++ b/qml/GampadTool.qml @@ -1,4 +1,4 @@ -import QtQuick 2.4 +import QtQuick 2.9 import QtQuick.Controls 2.2 import QtQuick.Layouts 1.2 diff --git a/qml/GoogleTosApprovalWindow.qml b/qml/GoogleTosApprovalWindow.qml index 23309e5..6c0fedf 100644 --- a/qml/GoogleTosApprovalWindow.qml +++ b/qml/GoogleTosApprovalWindow.qml @@ -1,4 +1,4 @@ -import QtQuick 2.4 +import QtQuick 2.9 import QtQuick.Controls 1.4 import QtQuick.Layouts 1.2 diff --git a/qml/Launcher.qml b/qml/Launcher.qml index 23d0782..d66571b 100644 --- a/qml/Launcher.qml +++ b/qml/Launcher.qml @@ -1,6 +1,6 @@ -import QtQuick -import QtQuick.Layouts -import QtQuick.Controls +import QtQuick 2.9 +import QtQuick.Layouts 1.2 +import QtQuick.Controls 2.0 import "ThemedControls" RowLayout { @@ -23,14 +23,14 @@ RowLayout { iconSource: "qrc:/Resources/icon-home.png" showText: useWideLayout onClicked: updateIndex(0) - checked: currentIndex == 0 + checked: currentIndex === 0 } MSideBarItem { text: qsTr("News") iconSource: "qrc:/Resources/icon-news.png" showText: useWideLayout onClicked: updateIndex(1) - checked: currentIndex == 1 + checked: currentIndex === 1 } Item { Layout.fillHeight: true @@ -40,7 +40,7 @@ RowLayout { iconSource: "qrc:/Resources/icon-settings.png" showText: useWideLayout onClicked: updateIndex(2) - checked: currentIndex == 2 + checked: currentIndex === 2 } } } @@ -83,8 +83,14 @@ RowLayout { } function updateIndex(index) { - if (index === currentIndex) + console.log("index=" + index) + console.log("currentIndex=" + currentIndex) + if (index === currentIndex) { + console.log("Nothing changed") + currentIndex = -1 + currentIndex = index return + } mainStackView.pop(null) diff --git a/qml/LauncherLogin.qml b/qml/LauncherLogin.qml index d1db40f..d4573b5 100644 --- a/qml/LauncherLogin.qml +++ b/qml/LauncherLogin.qml @@ -1,4 +1,4 @@ -import QtQuick 2.0 +import QtQuick 2.9 import QtQuick.Layouts 1.2 import QtQuick.Dialogs 1.2 import "ThemedControls" diff --git a/qml/LauncherMain.qml b/qml/LauncherMain.qml index 4148e76..e4e4bb6 100644 --- a/qml/LauncherMain.qml +++ b/qml/LauncherMain.qml @@ -3,6 +3,7 @@ import QtQuick.Window 2.2 import QtQuick.Dialogs 1.2 import QtQuick.Layouts 1.2 import QtQuick.Controls 2.2 +import Qt.labs.folderlistmodel 2.0 import "ThemedControls" import io.mrarm.mcpelauncher 1.0 @@ -10,7 +11,7 @@ LauncherBase { property GoogleLoginHelper googleLoginHelper property VersionManager versionManager property ProfileManager profileManager - property GoogleVersionChannel playVerChannelInstance + property GoogleVersionChannel playVerChannel property GooglePlayApi playApiInstance property bool isVersionsInitialized: false progressbarVisible: playDownloadTask.active || apkExtractionTask.active @@ -36,13 +37,12 @@ LauncherBase { Layout.fillWidth: true Layout.fillHeight: true id: backgroundArt - anchors.fill: parent source: wallpaperFolderModel.getRandomImage() smooth: true fillMode: Image.PreserveAspectCrop Image { id: launcherLogo - source: "qrc:/Resources/mcpelauncher-logo.svg" + source: "qrc:/Resources/mcpelauncher-logo.png" smooth: false y: 30 width: parent.width diff --git a/qml/LauncherSettingsAbout.qml b/qml/LauncherSettingsAbout.qml index ddecc19..c2a9079 100644 --- a/qml/LauncherSettingsAbout.qml +++ b/qml/LauncherSettingsAbout.qml @@ -64,10 +64,10 @@ ColumnLayout { updateCheckerConnectorSettings.enabled = false if (available) { updateInfo.text = qsTr("An Update of the Launcher is available for download") + "
" + (columnlayout.updateUrl.length !== 0 ? qsTr("You can download the new Update here: %1").arg(columnlayout.updateUrl) + "
" : "") + qsTr("Do you want to update now?") - updateInfo.buttons = MessageDialog.Yes | MessageDialog.No + updateInfo.standardButtons = MessageDialog.Yes | MessageDialog.No } else { updateInfo.text = qsTr("Your installed Launcher Version %1 (build %2) seems uptodate").arg(LAUNCHER_VERSION_NAME || '').arg(LAUNCHER_VERSION_CODE) - updateInfo.buttons = MessageDialog.Ok + updateInfo.standardButtons = MessageDialog.Ok } updateInfo.open() } diff --git a/qml/LauncherSettingsVersions.qml b/qml/LauncherSettingsVersions.qml index 5bf079f..f31db82 100644 --- a/qml/LauncherSettingsVersions.qml +++ b/qml/LauncherSettingsVersions.qml @@ -1,6 +1,6 @@ -import QtQuick -import QtQuick.Layouts -import QtQuick.Controls +import QtQuick 2.9 +import QtQuick.Layouts 1.2 +import QtQuick.Controls 2.0 import "ThemedControls" ColumnLayout { diff --git a/qml/LauncherSettingsWindow.qml b/qml/LauncherSettingsWindow.qml index 2eaf893..2a3cbe8 100644 --- a/qml/LauncherSettingsWindow.qml +++ b/qml/LauncherSettingsWindow.qml @@ -1,4 +1,4 @@ -import QtQuick 2.4 +import QtQuick 2.9 import QtQuick.Controls 2.2 import QtQuick.Layouts 1.3 import "ThemedControls" diff --git a/qml/ProfileComboBox.qml b/qml/ProfileComboBox.qml index 908ecd9..1aea546 100644 --- a/qml/ProfileComboBox.qml +++ b/qml/ProfileComboBox.qml @@ -1,4 +1,4 @@ -import QtQuick 2.0 +import QtQuick 2.9 import QtQuick.Controls 2.2 import "ThemedControls" diff --git a/qml/ThemedControls/BaseHeader.qml b/qml/ThemedControls/BaseHeader.qml index 76f1936..b78cf56 100644 --- a/qml/ThemedControls/BaseHeader.qml +++ b/qml/ThemedControls/BaseHeader.qml @@ -1,5 +1,5 @@ -import QtQuick -import QtQuick.Layouts +import QtQuick 2.9 +import QtQuick.Layouts 1.2 Rectangle { property string title diff --git a/qml/ThemedControls/CenteredScrollView.qml b/qml/ThemedControls/CenteredScrollView.qml index fe3c0d9..07de495 100644 --- a/qml/ThemedControls/CenteredScrollView.qml +++ b/qml/ThemedControls/CenteredScrollView.qml @@ -1,18 +1,34 @@ -import QtQuick -import QtQuick.Layouts -import QtQuick.Controls +import QtQuick 2.9 +import QtQuick.Layouts 1.2 +import QtQuick.Controls 2.2 ScrollView { - property alias content: item.data + id: scrollView + property alias content: childitem.data Layout.fillHeight: true Layout.fillWidth: true - contentHeight: item.height + 30 - Keys.forwardTo: item.children[0] + contentHeight: childitem.height + 30 + contentWidth: Math.max(childitem.width + 30, scrollView.width) + Keys.forwardTo: childitem.children[0] Item { id: item - anchors.centerIn: parent - width: Math.min(parent.width - 30, 760) - height: data[0].height + anchors.left: parent.left + anchors.top: parent.top + anchors.right: parent.right + anchors.bottom: parent.bottom + anchors.leftMargin: Math.max((scrollView.width - childitem.width) / 2, 15) + anchors.topMargin: 15 + anchors.bottomMargin: 15 + anchors.rightMargin: (function() { + var val = Math.max((scrollView.width - childitem.width) / 2, 15); + console.log("marginr=" + val); + return val; + })() + Item { + id: childitem + width: Math.min(Math.max(children[0].Layout.minimumWidth, scrollView.width - 30), 720) + height: data[0].height + } } } diff --git a/qml/ThemedControls/HorizontalDivider.qml b/qml/ThemedControls/HorizontalDivider.qml index 60d1dfd..cc8ae9f 100644 --- a/qml/ThemedControls/HorizontalDivider.qml +++ b/qml/ThemedControls/HorizontalDivider.qml @@ -1,5 +1,5 @@ -import QtQuick -import QtQuick.Layouts +import QtQuick 2.9 +import QtQuick.Layouts 1.2 Rectangle { Layout.fillWidth: true diff --git a/qml/ThemedControls/MBusyIndicator.qml b/qml/ThemedControls/MBusyIndicator.qml index 5a875b1..fd20fde 100644 --- a/qml/ThemedControls/MBusyIndicator.qml +++ b/qml/ThemedControls/MBusyIndicator.qml @@ -1,4 +1,4 @@ -import QtQuick 2.0 +import QtQuick 2.9 import QtQuick.Templates 2.1 as T T.BusyIndicator { diff --git a/qml/ThemedControls/MButton.qml b/qml/ThemedControls/MButton.qml index cdf6263..d8fbe8b 100644 --- a/qml/ThemedControls/MButton.qml +++ b/qml/ThemedControls/MButton.qml @@ -1,4 +1,4 @@ -import QtQuick 2.0 +import QtQuick 2.9 import QtQuick.Templates 2.1 as T T.Button { diff --git a/qml/ThemedControls/MCheckBox.qml b/qml/ThemedControls/MCheckBox.qml index 8937a9e..975d6eb 100644 --- a/qml/ThemedControls/MCheckBox.qml +++ b/qml/ThemedControls/MCheckBox.qml @@ -18,6 +18,7 @@ T.CheckBox { border.color: control.down ? "#888" : (control.hovered ? "#666" : "#555") Canvas { + id: canvas anchors.centerIn: parent width: 10 height: 10 @@ -51,6 +52,6 @@ T.CheckBox { color: "#fff" horizontalAlignment: Text.AlignLeft verticalAlignment: Text.AlignVCenter - leftPadding: implicitIndicatorWidth + 5 + leftPadding: indicator.implicitWidth + 5 } } diff --git a/qml/ThemedControls/MComboBox.qml b/qml/ThemedControls/MComboBox.qml index 9133814..6bf0f99 100644 --- a/qml/ThemedControls/MComboBox.qml +++ b/qml/ThemedControls/MComboBox.qml @@ -1,4 +1,4 @@ -import QtQuick 2.0 +import QtQuick 2.9 import QtQuick.Controls 2.2 import QtQuick.Templates 2.1 as T @@ -29,7 +29,7 @@ T.ComboBox { delegate: ItemDelegate { width: control.width contentItem: Text { - text: modelData + text: control.textRole ? (Array.isArray(control.model) ? modelData[control.textRole] : model[control.textRole]) : modelData color: "#fff" font.pointSize: 10 elide: Text.ElideRight @@ -75,7 +75,7 @@ T.ComboBox { popup: T.Popup { y: control.height width: control.width - height: Math.min(contentItem.implicitHeight + topPadding + bottomPadding, control.Window.height - topMargin - bottomMargin) + height: Math.min(contentItem.implicitHeight + topPadding + bottomPadding, 200) topMargin: 6 bottomMargin: 6 padding: 4 diff --git a/qml/ThemedControls/MProgressBar.qml b/qml/ThemedControls/MProgressBar.qml index 775e055..487fdd1 100644 --- a/qml/ThemedControls/MProgressBar.qml +++ b/qml/ThemedControls/MProgressBar.qml @@ -1,4 +1,4 @@ -import QtQuick 2.0 +import QtQuick 2.9 import QtQuick.Templates 2.1 as T T.ProgressBar { diff --git a/qml/ThemedControls/MSideBarItem.qml b/qml/ThemedControls/MSideBarItem.qml index 568143e..258963f 100644 --- a/qml/ThemedControls/MSideBarItem.qml +++ b/qml/ThemedControls/MSideBarItem.qml @@ -1,6 +1,6 @@ -import QtQuick -import QtQuick.Layouts -import QtQuick.Templates as T +import QtQuick 2.9 +import QtQuick.Layouts 1.2 +import QtQuick.Templates 2.1 as T T.Button { id: control @@ -8,7 +8,7 @@ T.Button { property alias showText: text.visible implicitHeight: 50 - implicitWidth: implicitContentWidth + implicitWidth: control.contentItem.implicitWidth background: Rectangle { color: "#eee" diff --git a/qml/ThemedControls/MTabButton.qml b/qml/ThemedControls/MTabButton.qml index a32095b..1e05792 100644 --- a/qml/ThemedControls/MTabButton.qml +++ b/qml/ThemedControls/MTabButton.qml @@ -1,10 +1,10 @@ -import QtQuick 2.0 +import QtQuick 2.9 import QtQuick.Templates 2.1 as T T.TabButton { id: control padding: 15 - implicitWidth: 15 + implicitContentWidth + leftPadding + rightPadding + implicitWidth: 15 + control.contentItem.implicitWidth + leftPadding + rightPadding implicitHeight: 40 anchors.bottom: parent.bottom diff --git a/qml/ThemedControls/MTextField.qml b/qml/ThemedControls/MTextField.qml index f2ab9e4..755b6d9 100644 --- a/qml/ThemedControls/MTextField.qml +++ b/qml/ThemedControls/MTextField.qml @@ -1,11 +1,10 @@ -import QtQuick 2.0 +import QtQuick 2.9 import QtQuick.Templates 2.1 as T T.TextField { id: control padding: 8 - implicitWidth: contentItem.implicitWidth + leftPadding + rightPadding implicitHeight: 35 verticalAlignment: TextInput.AlignVCenter font.pointSize: 10 diff --git a/qml/ThemedControls/PlayButton.qml b/qml/ThemedControls/PlayButton.qml index 623bd5a..9b33a77 100644 --- a/qml/ThemedControls/PlayButton.qml +++ b/qml/ThemedControls/PlayButton.qml @@ -1,4 +1,4 @@ -import QtQuick 2.0 +import QtQuick 2.9 import QtQuick.Layouts 1.2 import QtQuick.Templates 2.1 as T diff --git a/qml/ThemedControls/TransparentButton.qml b/qml/ThemedControls/TransparentButton.qml index d7399b2..780d4da 100644 --- a/qml/ThemedControls/TransparentButton.qml +++ b/qml/ThemedControls/TransparentButton.qml @@ -1,4 +1,4 @@ -import QtQuick 2.0 +import QtQuick 2.9 import QtQuick.Templates 2.1 as T T.Button { diff --git a/qml/TroubleshooterWindow.qml b/qml/TroubleshooterWindow.qml index 2ab25bd..eb4cb8d 100644 --- a/qml/TroubleshooterWindow.qml +++ b/qml/TroubleshooterWindow.qml @@ -1,4 +1,4 @@ -import QtQuick 2.4 +import QtQuick 2.9 import QtQuick.Controls 2.2 import QtQuick.Layouts 1.2 diff --git a/qml/main.qml b/qml/main.qml index adadc6c..122fc80 100644 --- a/qml/main.qml +++ b/qml/main.qml @@ -124,6 +124,7 @@ Window { TroubleshooterWindow { id: troubleshooterWindow googleLoginHelper: googleLoginHelperInstance + playVerChannel: playVerChannelInstance } GoogleTosApprovalWindow {