NOISSUE Show ATLauncher pack descriptions in text browser

This commit is contained in:
Jamie Mansfield 2021-02-10 16:11:59 +00:00
parent 6b3b7ded2d
commit 003e019048
No known key found for this signature in database
GPG Key ID: 36F61598F39F67B0
3 changed files with 26 additions and 21 deletions

View File

@ -39,7 +39,7 @@ QVariant ListModel::data(const QModelIndex &index, int role) const
} }
else if (role == Qt::ToolTipRole) else if (role == Qt::ToolTipRole)
{ {
return pack.description; return pack.name;
} }
else if(role == Qt::DecorationRole) else if(role == Qt::DecorationRole)
{ {

View File

@ -80,6 +80,8 @@ void AtlPage::onSelectionChanged(QModelIndex first, QModelIndex second)
selected = filterModel->data(first, Qt::UserRole).value<ATLauncher::IndexedPack>(); selected = filterModel->data(first, Qt::UserRole).value<ATLauncher::IndexedPack>();
ui->packDescription->setHtml(selected.description.replace("\n", "<br>"));
for(const auto& version : selected.versions) { for(const auto& version : selected.versions) {
ui->versionSelectionBox->addItem(version.version); ui->versionSelectionBox->addItem(version.version);
} }

View File

@ -11,26 +11,6 @@
</rect> </rect>
</property> </property>
<layout class="QGridLayout" name="gridLayout"> <layout class="QGridLayout" name="gridLayout">
<item row="1" column="0" colspan="2">
<layout class="QGridLayout" name="gridLayout_4" columnstretch="0,0,0" rowminimumheight="0" columnminimumwidth="0,0,0">
<item row="0" column="2">
<widget class="QComboBox" name="versionSelectionBox"/>
</item>
<item row="0" column="1">
<widget class="QLabel" name="label">
<property name="text">
<string>Version selected:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QComboBox" name="sortByBox"/>
</item>
</layout>
</item>
<item row="0" column="0" colspan="2"> <item row="0" column="0" colspan="2">
<widget class="QTreeView" name="packView"> <widget class="QTreeView" name="packView">
<property name="alternatingRowColors"> <property name="alternatingRowColors">
@ -44,6 +24,29 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="0" column="2">
<widget class="QTextBrowser" name="packDescription"/>
</item>
<item row="1" column="0" colspan="3">
<layout class="QGridLayout" name="gridLayout_4" columnstretch="0,0,0">
<item row="0" column="2">
<widget class="QComboBox" name="versionSelectionBox"/>
</item>
<item row="0" column="0">
<widget class="QComboBox" name="sortByBox"/>
</item>
<item row="0" column="1">
<widget class="QLabel" name="label">
<property name="text">
<string>Version selected:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
</layout>
</item>
</layout> </layout>
</widget> </widget>
<tabstops> <tabstops>