Merge branch 'develop' of https://github.com/PrismLauncher/PrismLauncher into catpacks

This commit is contained in:
Trial97
2023-07-02 13:14:19 +03:00
118 changed files with 1685 additions and 2530 deletions

View File

@ -14,9 +14,6 @@
*/
#include "ModListView.h"
#include "minecraft/mod/ModFolderModel.h"
#include <QHeaderView>
#include <QMouseEvent>
#include <QPainter>
@ -65,19 +62,6 @@ void ModListView::setModel ( QAbstractItemModel* model )
for(int i = 1; i < head->count(); i++)
head->setSectionResizeMode(i, QHeaderView::ResizeToContents);
}
auto real_model = model;
if (auto proxy_model = dynamic_cast<QSortFilterProxyModel*>(model); proxy_model)
real_model = proxy_model->sourceModel();
if (auto mod_model = dynamic_cast<ModFolderModel*>(real_model); mod_model) {
connect(mod_model, &ModFolderModel::updateFinished, this, [this, mod_model]{
auto mods = mod_model->allMods();
// Hide the 'Provider' column if no mod has a defined provider!
setColumnHidden(ModFolderModel::Columns::ProviderColumn,
std::none_of(mods.constBegin(), mods.constEnd(), [](auto const mod){ return mod->provider().has_value(); }));
});
}
}
void ModListView::setResizeModes(const QList<QHeaderView::ResizeMode> &modes)

View File

@ -93,8 +93,8 @@ PageContainer::PageContainer(BasePageProvider *pageProvider, QString defaultId,
page->listIndex = counter;
page->setParentContainer(this);
counter++;
page->updateExtraInfo = [this](QString info) {
if (m_currentPage)
page->updateExtraInfo = [this](QString id, QString info) {
if (m_currentPage && id == m_currentPage->id())
m_header->setText(m_currentPage->displayName() + info);
};
}