aboutsummaryrefslogtreecommitdiff
path: root/application/pages/modplatform/atlauncher
diff options
context:
space:
mode:
authorphit <2097483+phit@users.noreply.github.com>2021-06-19 16:19:39 +0200
committerphit <2097483+phit@users.noreply.github.com>2021-06-20 01:03:17 +0200
commitf7c144c3932a18e1cd96e1ad7505e53ea706a47d (patch)
tree41db6a9b877d269b941c07ba738dba5bf92051e6 /application/pages/modplatform/atlauncher
parent5f8d07c0092b6cc44f81104a3d7f9e7e49d9df5d (diff)
downloadPrismLauncher-f7c144c3932a18e1cd96e1ad7505e53ea706a47d.tar.gz
PrismLauncher-f7c144c3932a18e1cd96e1ad7505e53ea706a47d.tar.bz2
PrismLauncher-f7c144c3932a18e1cd96e1ad7505e53ea706a47d.zip
GH-3720 Fix UI inconsistencies with Modplatforms
Fixes GH-3118 Fixes GH-3720 Fixes GH-3731 Icons and Ok button state will now switch consistently when moving between tabs. ATLaunchers packlist is now no longer redownloaded each time you open its Tab. All lists are striped now. And all search and filter fields now have a placeholder text.
Diffstat (limited to 'application/pages/modplatform/atlauncher')
-rw-r--r--application/pages/modplatform/atlauncher/AtlPage.cpp20
-rw-r--r--application/pages/modplatform/atlauncher/AtlPage.h2
-rw-r--r--application/pages/modplatform/atlauncher/AtlPage.ui12
3 files changed, 30 insertions, 4 deletions
diff --git a/application/pages/modplatform/atlauncher/AtlPage.cpp b/application/pages/modplatform/atlauncher/AtlPage.cpp
index 748f467c..1b61ebd0 100644
--- a/application/pages/modplatform/atlauncher/AtlPage.cpp
+++ b/application/pages/modplatform/atlauncher/AtlPage.cpp
@@ -45,15 +45,29 @@ bool AtlPage::shouldDisplay() const
void AtlPage::openedImpl()
{
- listModel->request();
+ if(!initialized)
+ {
+ listModel->request();
+ initialized = true;
+ }
+
+ suggestCurrent();
}
void AtlPage::suggestCurrent()
{
- if(isOpened) {
- dialog->setSuggestedPack(selected.name, new ATLauncher::PackInstallTask(this, selected.safeName, selectedVersion));
+ if(!isOpened)
+ {
+ return;
+ }
+
+ if (selectedVersion.isEmpty())
+ {
+ dialog->setSuggestedPack();
+ return;
}
+ dialog->setSuggestedPack(selected.name, new ATLauncher::PackInstallTask(this, selected.safeName, selectedVersion));
auto editedLogoName = selected.safeName;
auto url = QString(BuildConfig.ATL_DOWNLOAD_SERVER_URL + "launcher/images/%1.png").arg(selected.safeName.toLower());
listModel->getLogo(selected.safeName, url, [this, editedLogoName](QString logo)
diff --git a/application/pages/modplatform/atlauncher/AtlPage.h b/application/pages/modplatform/atlauncher/AtlPage.h
index 6a89b609..18f8b1c6 100644
--- a/application/pages/modplatform/atlauncher/AtlPage.h
+++ b/application/pages/modplatform/atlauncher/AtlPage.h
@@ -81,4 +81,6 @@ private:
ATLauncher::IndexedPack selected;
QString selectedVersion;
+
+ bool initialized = false;
};
diff --git a/application/pages/modplatform/atlauncher/AtlPage.ui b/application/pages/modplatform/atlauncher/AtlPage.ui
index bb0d5310..0860a873 100644
--- a/application/pages/modplatform/atlauncher/AtlPage.ui
+++ b/application/pages/modplatform/atlauncher/AtlPage.ui
@@ -21,6 +21,9 @@
<height>48</height>
</size>
</property>
+ <property name="alternatingRowColors">
+ <bool>true</bool>
+ </property>
</widget>
</item>
<item row="1" column="1">
@@ -48,7 +51,14 @@
<item row="2" column="0" colspan="2">
<layout class="QGridLayout" name="gridLayout_4" columnstretch="0,0,0" rowminimumheight="0" columnminimumwidth="0,0,0">
<item row="0" column="2">
- <widget class="QComboBox" name="versionSelectionBox"/>
+ <widget class="QComboBox" name="versionSelectionBox">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
</item>
<item row="0" column="1">
<widget class="QLabel" name="label">