rework: make the filter as a tabbed widget in the dialog itself

Still needs a clear indication that the filter only applies after you
click the search button...
This commit is contained in:
flow
2022-04-14 10:27:03 -03:00
parent 63bce04648
commit 277de41200
11 changed files with 138 additions and 247 deletions

View File

@ -5,9 +5,9 @@
#include "Application.h"
#include "modplatform/ModAPI.h"
#include "modplatform/ModIndex.h"
#include "ui/dialogs/FilterModsDialog.h"
#include "ui/pages/BasePage.h"
#include "ui/pages/modplatform/ModModel.h"
#include "ui/widgets/ModFilterWidget.h"
class ModDownloadDialog;
@ -40,7 +40,7 @@ class ModPage : public QWidget, public BasePage {
virtual auto validateVersion(ModPlatform::IndexedVersion& ver, QString mineVer, QString loaderVer = "") const -> bool = 0;
auto apiProvider() const -> const ModAPI* { return api.get(); };
auto getFilter() const -> const std::shared_ptr<FilterModsDialog::Filter> { return m_filter; }
auto getFilter() const -> const std::shared_ptr<ModFilterWidget::Filter> { return m_filter; }
auto getCurrent() -> ModPlatform::IndexedPack& { return current; }
void updateModVersions(int prev_count = -1);
@ -64,8 +64,8 @@ class ModPage : public QWidget, public BasePage {
Ui::ModPage* ui = nullptr;
ModDownloadDialog* dialog = nullptr;
FilterModsDialog filter_dialog;
std::shared_ptr<FilterModsDialog::Filter> m_filter;
ModFilterWidget filter_widget;
std::shared_ptr<ModFilterWidget::Filter> m_filter;
ModPlatform::ListModel* listModel = nullptr;
ModPlatform::IndexedPack current;