aboutsummaryrefslogtreecommitdiff
path: root/launcher/ui
diff options
context:
space:
mode:
Diffstat (limited to 'launcher/ui')
-rw-r--r--launcher/ui/dialogs/AboutDialog.ui13
-rw-r--r--launcher/ui/dialogs/ModUpdateDialog.cpp15
-rw-r--r--launcher/ui/pages/modplatform/ModModel.cpp25
-rw-r--r--launcher/ui/pages/modplatform/ModModel.h1
-rw-r--r--launcher/ui/pages/modplatform/atlauncher/AtlOptionalModDialog.cpp2
-rw-r--r--launcher/ui/themes/DarkTheme.cpp2
6 files changed, 29 insertions, 29 deletions
diff --git a/launcher/ui/dialogs/AboutDialog.ui b/launcher/ui/dialogs/AboutDialog.ui
index e0429321..4a9eef08 100644
--- a/launcher/ui/dialogs/AboutDialog.ui
+++ b/launcher/ui/dialogs/AboutDialog.ui
@@ -87,14 +87,11 @@
</property>
</widget>
</item>
- <item>
+ <item alignment="Qt::AlignHCenter">
<widget class="QLabel" name="versionLabel">
<property name="cursor">
<cursorShape>IBeamCursor</cursorShape>
</property>
- <property name="alignment">
- <set>Qt::AlignCenter</set>
- </property>
<property name="textInteractionFlags">
<set>Qt::TextSelectableByMouse</set>
</property>
@@ -167,7 +164,7 @@
</property>
</widget>
</item>
- <item>
+ <item alignment="Qt::AlignHCenter">
<widget class="QLabel" name="platformLabel">
<property name="cursor">
<cursorShape>IBeamCursor</cursorShape>
@@ -183,7 +180,7 @@
</property>
</widget>
</item>
- <item>
+ <item alignment="Qt::AlignHCenter">
<widget class="QLabel" name="buildDateLabel">
<property name="cursor">
<cursorShape>IBeamCursor</cursorShape>
@@ -199,7 +196,7 @@
</property>
</widget>
</item>
- <item>
+ <item alignment="Qt::AlignHCenter">
<widget class="QLabel" name="commitLabel">
<property name="cursor">
<cursorShape>IBeamCursor</cursorShape>
@@ -215,7 +212,7 @@
</property>
</widget>
</item>
- <item>
+ <item alignment="Qt::AlignHCenter">
<widget class="QLabel" name="channelLabel">
<property name="cursor">
<cursorShape>IBeamCursor</cursorShape>
diff --git a/launcher/ui/dialogs/ModUpdateDialog.cpp b/launcher/ui/dialogs/ModUpdateDialog.cpp
index 4171586e..cedd4a96 100644
--- a/launcher/ui/dialogs/ModUpdateDialog.cpp
+++ b/launcher/ui/dialogs/ModUpdateDialog.cpp
@@ -366,33 +366,28 @@ void ModUpdateDialog::appendMod(CheckUpdateTask::UpdatableMod const& info)
auto changelog = new QTreeWidgetItem(changelog_item);
auto changelog_area = new QTextBrowser();
+ QString text = info.changelog;
switch (info.provider) {
case ModPlatform::Provider::MODRINTH: {
HoeDown h;
// HoeDown bug?: \n aren't converted to <br>
- auto text = h.process(info.changelog.toUtf8());
+ text = h.process(info.changelog.toUtf8());
// Don't convert if there's an HTML tag right after (Qt rendering weirdness)
text.remove(QRegularExpression("(\n+)(?=<)"));
text.replace('\n', "<br>");
- changelog_area->setHtml(text);
break;
}
- case ModPlatform::Provider::FLAME: {
- changelog_area->setHtml(info.changelog);
+ default:
break;
- }
}
+ changelog_area->setHtml(text);
changelog_area->setOpenExternalLinks(true);
- changelog_area->setLineWrapMode(QTextBrowser::LineWrapMode::NoWrap);
+ changelog_area->setLineWrapMode(QTextBrowser::LineWrapMode::WidgetWidth);
changelog_area->setVerticalScrollBarPolicy(Qt::ScrollBarPolicy::ScrollBarAsNeeded);
- // HACK: Is there a better way of achieving this?
- auto font_height = QFontMetrics(changelog_area->font()).height();
- changelog_area->setMaximumHeight((changelog_area->toPlainText().count(QRegularExpression("\n|<br>")) + 2) * font_height);
-
ui->modTreeWidget->setItemWidget(changelog, 0, changelog_area);
ui->modTreeWidget->addTopLevelItem(item_top);
diff --git a/launcher/ui/pages/modplatform/ModModel.cpp b/launcher/ui/pages/modplatform/ModModel.cpp
index 49766fa6..ed58eb32 100644
--- a/launcher/ui/pages/modplatform/ModModel.cpp
+++ b/launcher/ui/pages/modplatform/ModModel.cpp
@@ -267,18 +267,25 @@ void ListModel::searchRequestFailed(QString reason)
.arg(m_parent->displayName())
.arg(tr("API version too old!\nPlease update %1!").arg(BuildConfig.LAUNCHER_DISPLAYNAME)));
}
+
jobPtr.reset();
+ searchState = Finished;
+}
- if (searchState == ResetRequested) {
- beginResetModel();
- modpacks.clear();
- endResetModel();
+void ListModel::searchRequestAborted()
+{
+ if (searchState != ResetRequested)
+ qCritical() << "Search task in ModModel aborted by an unknown reason!";
- nextSearchOffset = 0;
- performPaginatedSearch();
- } else {
- searchState = Finished;
- }
+ // Retry fetching
+ jobPtr.reset();
+
+ beginResetModel();
+ modpacks.clear();
+ endResetModel();
+
+ nextSearchOffset = 0;
+ performPaginatedSearch();
}
void ListModel::infoRequestFinished(QJsonDocument& doc, ModPlatform::IndexedPack& pack, const QModelIndex& index)
diff --git a/launcher/ui/pages/modplatform/ModModel.h b/launcher/ui/pages/modplatform/ModModel.h
index a58c7c55..d2636d87 100644
--- a/launcher/ui/pages/modplatform/ModModel.h
+++ b/launcher/ui/pages/modplatform/ModModel.h
@@ -51,6 +51,7 @@ class ListModel : public QAbstractListModel {
public slots:
void searchRequestFinished(QJsonDocument& doc);
void searchRequestFailed(QString reason);
+ void searchRequestAborted();
void infoRequestFinished(QJsonDocument& doc, ModPlatform::IndexedPack& pack, const QModelIndex& index);
diff --git a/launcher/ui/pages/modplatform/atlauncher/AtlOptionalModDialog.cpp b/launcher/ui/pages/modplatform/atlauncher/AtlOptionalModDialog.cpp
index 004fdc57..9138dcbb 100644
--- a/launcher/ui/pages/modplatform/atlauncher/AtlOptionalModDialog.cpp
+++ b/launcher/ui/pages/modplatform/atlauncher/AtlOptionalModDialog.cpp
@@ -331,7 +331,7 @@ AtlOptionalModDialog::AtlOptionalModDialog(QWidget* parent, ATLauncher::PackVers
connect(ui->clearAllButton, &QPushButton::clicked,
listModel, &AtlOptionalModListModel::clearAll);
connect(ui->installButton, &QPushButton::clicked,
- this, &QDialog::close);
+ this, &QDialog::accept);
}
AtlOptionalModDialog::~AtlOptionalModDialog() {
diff --git a/launcher/ui/themes/DarkTheme.cpp b/launcher/ui/themes/DarkTheme.cpp
index 07a2efd2..48231b53 100644
--- a/launcher/ui/themes/DarkTheme.cpp
+++ b/launcher/ui/themes/DarkTheme.cpp
@@ -31,7 +31,7 @@ QPalette DarkTheme::colorScheme()
darkPalette.setColor(QPalette::ButtonText, Qt::white);
darkPalette.setColor(QPalette::BrightText, Qt::red);
darkPalette.setColor(QPalette::Link, QColor(47,163,198));
- darkPalette.setColor(QPalette::Highlight, QColor(145,205,92));
+ darkPalette.setColor(QPalette::Highlight, QColor(150,219,89));
darkPalette.setColor(QPalette::HighlightedText, Qt::black);
darkPalette.setColor(QPalette::PlaceholderText, Qt::darkGray);
return fadeInactive(darkPalette, fadeAmount(), fadeColor());