From f7c144c3932a18e1cd96e1ad7505e53ea706a47d Mon Sep 17 00:00:00 2001 From: phit <2097483+phit@users.noreply.github.com> Date: Sat, 19 Jun 2021 16:19:39 +0200 Subject: 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. --- application/pages/modplatform/technic/TechnicModel.cpp | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'application/pages/modplatform/technic/TechnicModel.cpp') diff --git a/application/pages/modplatform/technic/TechnicModel.cpp b/application/pages/modplatform/technic/TechnicModel.cpp index bf256ab6..a240a94a 100644 --- a/application/pages/modplatform/technic/TechnicModel.cpp +++ b/application/pages/modplatform/technic/TechnicModel.cpp @@ -72,7 +72,7 @@ int Technic::ListModel::rowCount(const QModelIndex&) const void Technic::ListModel::searchWithTerm(const QString& term) { - if(currentSearchTerm == term) { + if(currentSearchTerm == term && currentSearchTerm.isNull() == term.isNull()) { return; } currentSearchTerm = term; @@ -93,9 +93,18 @@ void Technic::ListModel::searchWithTerm(const QString& term) void Technic::ListModel::performSearch() { NetJob *netJob = new NetJob("Technic::Search"); - auto searchUrl = QString( - "https://api.technicpack.net/search?build=multimc&q=%1" - ).arg(currentSearchTerm); + QString searchUrl = ""; + if (currentSearchTerm.isEmpty()) { + searchUrl = QString( + "https://api.technicpack.net/trending?build=multimc" + ).arg(currentSearchTerm); + } + else + { + searchUrl = QString( + "https://api.technicpack.net/search?build=multimc&q=%1" + ).arg(currentSearchTerm); + } netJob->addNetAction(Net::Download::makeByteArray(QUrl(searchUrl), &response)); jobPtr = netJob; jobPtr->start(); -- cgit