aboutsummaryrefslogtreecommitdiff
path: root/application/pages/modplatform/ftb
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/ftb
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/ftb')
-rw-r--r--application/pages/modplatform/ftb/FtbPage.cpp35
-rw-r--r--application/pages/modplatform/ftb/FtbPage.ui9
2 files changed, 29 insertions, 15 deletions
diff --git a/application/pages/modplatform/ftb/FtbPage.cpp b/application/pages/modplatform/ftb/FtbPage.cpp
index dd2ff666..b49982d5 100644
--- a/application/pages/modplatform/ftb/FtbPage.cpp
+++ b/application/pages/modplatform/ftb/FtbPage.cpp
@@ -60,26 +60,33 @@ bool FtbPage::shouldDisplay() const
void FtbPage::openedImpl()
{
- dialog->setSuggestedPack();
triggerSearch();
+ suggestCurrent();
}
void FtbPage::suggestCurrent()
{
- if(isOpened)
+ if(!isOpened)
+ {
+ return;
+ }
+
+ if (selectedVersion.isEmpty())
{
- dialog->setSuggestedPack(selected.name, new ModpacksCH::PackInstallTask(selected, selectedVersion));
-
- for(auto art : selected.art) {
- if(art.type == "square") {
- QString editedLogoName;
- editedLogoName = selected.name;
-
- listModel->getLogo(selected.name, art.url, [this, editedLogoName](QString logo)
- {
- dialog->setSuggestedIconFromFile(logo + ".small", editedLogoName);
- });
- }
+ dialog->setSuggestedPack();
+ return;
+ }
+
+ dialog->setSuggestedPack(selected.name, new ModpacksCH::PackInstallTask(selected, selectedVersion));
+ for(auto art : selected.art) {
+ if(art.type == "square") {
+ QString editedLogoName;
+ editedLogoName = selected.name;
+
+ listModel->getLogo(selected.name, art.url, [this, editedLogoName](QString logo)
+ {
+ dialog->setSuggestedIconFromFile(logo + ".small", editedLogoName);
+ });
}
}
}
diff --git a/application/pages/modplatform/ftb/FtbPage.ui b/application/pages/modplatform/ftb/FtbPage.ui
index 475d78bb..135afc6d 100644
--- a/application/pages/modplatform/ftb/FtbPage.ui
+++ b/application/pages/modplatform/ftb/FtbPage.ui
@@ -32,7 +32,11 @@
</layout>
</item>
<item row="0" column="0">
- <widget class="QLineEdit" name="searchEdit"/>
+ <widget class="QLineEdit" name="searchEdit">
+ <property name="placeholderText">
+ <string>Search and filter ...</string>
+ </property>
+ </widget>
</item>
<item row="0" column="1">
<widget class="QPushButton" name="searchButton">
@@ -51,6 +55,9 @@
<height>48</height>
</size>
</property>
+ <property name="alternatingRowColors">
+ <bool>true</bool>
+ </property>
</widget>
</item>
<item row="0" column="1">