mirror of
https://github.com/PrismLauncher/PrismLauncher.git
synced 2025-06-12 13:17:41 +02:00
Merge branch 'develop' of https://github.com/PrismLauncher/PrismLauncher into feature/java-downloader
This commit is contained in:
@ -84,7 +84,7 @@ void JavaSettingsWidget::setupUi()
|
||||
m_minMemSpinBox = new QSpinBox(m_memoryGroupBox);
|
||||
m_minMemSpinBox->setObjectName(QStringLiteral("minMemSpinBox"));
|
||||
m_minMemSpinBox->setSuffix(QStringLiteral(" MiB"));
|
||||
m_minMemSpinBox->setMinimum(128);
|
||||
m_minMemSpinBox->setMinimum(8);
|
||||
m_minMemSpinBox->setMaximum(1048576);
|
||||
m_minMemSpinBox->setSingleStep(128);
|
||||
m_labelMinMem->setBuddy(m_minMemSpinBox);
|
||||
@ -97,7 +97,7 @@ void JavaSettingsWidget::setupUi()
|
||||
m_maxMemSpinBox = new QSpinBox(m_memoryGroupBox);
|
||||
m_maxMemSpinBox->setObjectName(QStringLiteral("maxMemSpinBox"));
|
||||
m_maxMemSpinBox->setSuffix(QStringLiteral(" MiB"));
|
||||
m_maxMemSpinBox->setMinimum(128);
|
||||
m_maxMemSpinBox->setMinimum(8);
|
||||
m_maxMemSpinBox->setMaximum(1048576);
|
||||
m_maxMemSpinBox->setSingleStep(128);
|
||||
m_labelMaxMem->setBuddy(m_maxMemSpinBox);
|
||||
@ -116,7 +116,7 @@ void JavaSettingsWidget::setupUi()
|
||||
m_permGenSpinBox = new QSpinBox(m_memoryGroupBox);
|
||||
m_permGenSpinBox->setObjectName(QStringLiteral("permGenSpinBox"));
|
||||
m_permGenSpinBox->setSuffix(QStringLiteral(" MiB"));
|
||||
m_permGenSpinBox->setMinimum(64);
|
||||
m_permGenSpinBox->setMinimum(4);
|
||||
m_permGenSpinBox->setMaximum(1048576);
|
||||
m_permGenSpinBox->setSingleStep(8);
|
||||
m_gridLayout_2->addWidget(m_permGenSpinBox, 2, 1, 1, 1);
|
||||
|
@ -76,7 +76,7 @@ void LanguageSelectionWidget::languageRowChanged(const QModelIndex& current, con
|
||||
translations->updateLanguage(key);
|
||||
}
|
||||
|
||||
void LanguageSelectionWidget::languageSettingChanged(const Setting&, const QVariant)
|
||||
void LanguageSelectionWidget::languageSettingChanged(const Setting&, const QVariant&)
|
||||
{
|
||||
auto translations = APPLICATION->translations();
|
||||
auto index = translations->selectedIndex();
|
||||
|
@ -34,7 +34,7 @@ class LanguageSelectionWidget : public QWidget {
|
||||
|
||||
protected slots:
|
||||
void languageRowChanged(const QModelIndex& current, const QModelIndex& previous);
|
||||
void languageSettingChanged(const Setting&, const QVariant);
|
||||
void languageSettingChanged(const Setting&, const QVariant&);
|
||||
|
||||
private:
|
||||
QVBoxLayout* verticalLayout = nullptr;
|
||||
|
@ -48,14 +48,14 @@ void ModListView::setModel(QAbstractItemModel* model)
|
||||
return;
|
||||
}
|
||||
if (!string.size()) {
|
||||
head->setSectionResizeMode(0, QHeaderView::ResizeToContents);
|
||||
head->setSectionResizeMode(0, QHeaderView::Interactive);
|
||||
head->setSectionResizeMode(1, QHeaderView::Stretch);
|
||||
for (int i = 2; i < head->count(); i++)
|
||||
head->setSectionResizeMode(i, QHeaderView::ResizeToContents);
|
||||
head->setSectionResizeMode(i, QHeaderView::Interactive);
|
||||
} else {
|
||||
head->setSectionResizeMode(0, QHeaderView::Stretch);
|
||||
for (int i = 1; i < head->count(); i++)
|
||||
head->setSectionResizeMode(i, QHeaderView::ResizeToContents);
|
||||
head->setSectionResizeMode(i, QHeaderView::Interactive);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -88,7 +88,7 @@ void ProjectItemDelegate::paint(QPainter* painter, const QStyleOptionViewItem& o
|
||||
}
|
||||
|
||||
{ // Description painting
|
||||
auto description = index.data(UserDataTypes::DESCRIPTION).toString();
|
||||
auto description = index.data(UserDataTypes::DESCRIPTION).toString().simplified();
|
||||
|
||||
QTextLayout text_layout(description, opt.font);
|
||||
|
||||
|
@ -34,11 +34,11 @@ ThemeCustomizationWidget::ThemeCustomizationWidget(QWidget* parent) : QWidget(pa
|
||||
connect(ui->backgroundCatComboBox, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &ThemeCustomizationWidget::applyCatTheme);
|
||||
|
||||
connect(ui->iconsFolder, &QPushButton::clicked, this,
|
||||
[] { DesktopServices::openDirectory(APPLICATION->themeManager()->getIconThemesFolder().path()); });
|
||||
[] { DesktopServices::openPath(APPLICATION->themeManager()->getIconThemesFolder().path()); });
|
||||
connect(ui->widgetStyleFolder, &QPushButton::clicked, this,
|
||||
[] { DesktopServices::openDirectory(APPLICATION->themeManager()->getApplicationThemesFolder().path()); });
|
||||
[] { DesktopServices::openPath(APPLICATION->themeManager()->getApplicationThemesFolder().path()); });
|
||||
connect(ui->catPackFolder, &QPushButton::clicked, this,
|
||||
[] { DesktopServices::openDirectory(APPLICATION->themeManager()->getCatPacksFolder().path()); });
|
||||
[] { DesktopServices::openPath(APPLICATION->themeManager()->getCatPacksFolder().path()); });
|
||||
}
|
||||
|
||||
ThemeCustomizationWidget::~ThemeCustomizationWidget()
|
||||
|
@ -102,14 +102,7 @@ void VariableSizedImageObject::loadImage(QTextDocument* doc, const QUrl& source,
|
||||
|
||||
auto full_entry_path = entry->getFullPath();
|
||||
auto source_url = source;
|
||||
connect(job, &NetJob::succeeded, this, [this, doc, full_entry_path, source_url, posInDocument] {
|
||||
qDebug() << "Loaded resource at" << full_entry_path;
|
||||
|
||||
// If we flushed, don't proceed.
|
||||
if (!m_fetching_images.contains(source_url))
|
||||
return;
|
||||
|
||||
QImage image(full_entry_path);
|
||||
auto loadImage = [this, doc, full_entry_path, source_url, posInDocument](const QImage& image) {
|
||||
doc->addResource(QTextDocument::ImageResource, source_url, image);
|
||||
|
||||
parseImage(doc, image, posInDocument);
|
||||
@ -121,6 +114,23 @@ void VariableSizedImageObject::loadImage(QTextDocument* doc, const QUrl& source,
|
||||
doc->setPageSize(size);
|
||||
|
||||
m_fetching_images.remove(source_url);
|
||||
};
|
||||
connect(job, &NetJob::succeeded, this, [this, full_entry_path, source_url, loadImage] {
|
||||
qDebug() << "Loaded resource at:" << full_entry_path;
|
||||
// If we flushed, don't proceed.
|
||||
if (!m_fetching_images.contains(source_url))
|
||||
return;
|
||||
|
||||
QImage image(full_entry_path);
|
||||
loadImage(image);
|
||||
});
|
||||
connect(job, &NetJob::failed, this, [this, full_entry_path, source_url, loadImage](QString reason) {
|
||||
qWarning() << "Failed resource at:" << full_entry_path << " because:" << reason;
|
||||
// If we flushed, don't proceed.
|
||||
if (!m_fetching_images.contains(source_url))
|
||||
return;
|
||||
|
||||
loadImage(QImage());
|
||||
});
|
||||
connect(job, &NetJob::finished, job, &NetJob::deleteLater);
|
||||
|
||||
|
Reference in New Issue
Block a user