diff options
Diffstat (limited to 'application/pages/modplatform')
-rw-r--r-- | application/pages/modplatform/FTBPage.cpp | 11 | ||||
-rw-r--r-- | application/pages/modplatform/FTBPage.h | 2 | ||||
-rw-r--r-- | application/pages/modplatform/FTBPage.ui | 56 |
3 files changed, 40 insertions, 29 deletions
diff --git a/application/pages/modplatform/FTBPage.cpp b/application/pages/modplatform/FTBPage.cpp index 3b808799..8c8d8a7d 100644 --- a/application/pages/modplatform/FTBPage.cpp +++ b/application/pages/modplatform/FTBPage.cpp @@ -53,7 +53,12 @@ FTBPage::FTBPage(NewInstanceDialog* dialog, QWidget *parent) connect(ui->publicPackList->selectionModel(), &QItemSelectionModel::currentChanged, this, &FTBPage::onPublicPackSelectionChanged); connect(ui->thirdPartyPackList->selectionModel(), &QItemSelectionModel::currentChanged, this, &FTBPage::onThirdPartyPackSelectionChanged); + connect(ui->ftbTabWidget, &QTabWidget::currentChanged, this, &FTBPage::onTabChanged); + ui->modpackInfo->setOpenExternalLinks(true); + + ui->publicPackList->selectionModel()->reset(); + ui->thirdPartyPackList->selectionModel()->reset(); } FTBPage::~FTBPage() @@ -172,3 +177,9 @@ void FTBPage::onSortingSelectionChanged(QString data) publicFilterModel->setSorting(toSet); thirdPartyFilterModel->setSorting(toSet); } + +void FTBPage::onTabChanged(int tab) +{ + ui->publicPackList->selectionModel()->reset(); + ui->thirdPartyPackList->selectionModel()->reset(); +} diff --git a/application/pages/modplatform/FTBPage.h b/application/pages/modplatform/FTBPage.h index ba8dd299..413f5e28 100644 --- a/application/pages/modplatform/FTBPage.h +++ b/application/pages/modplatform/FTBPage.h @@ -75,6 +75,8 @@ private slots: void onPublicPackSelectionChanged(QModelIndex first, QModelIndex second); void onThirdPartyPackSelectionChanged(QModelIndex first, QModelIndex second); + void onTabChanged(int tab); + private: bool initialized = false; FtbModpack selectedPack; diff --git a/application/pages/modplatform/FTBPage.ui b/application/pages/modplatform/FTBPage.ui index ee91f1f5..cb085af2 100644 --- a/application/pages/modplatform/FTBPage.ui +++ b/application/pages/modplatform/FTBPage.ui @@ -10,7 +10,7 @@ <height>602</height> </rect> </property> - <layout class="QGridLayout" name="gridLayout_2"> + <layout class="QVBoxLayout" name="verticalLayout"> <property name="leftMargin"> <number>0</number> </property> @@ -23,7 +23,7 @@ <property name="bottomMargin"> <number>0</number> </property> - <item row="0" column="0"> + <item> <widget class="QTabWidget" name="tabWidget"> <property name="currentIndex"> <number>0</number> @@ -57,7 +57,7 @@ <widget class="QComboBox" name="sortByBox"/> </item> <item row="0" column="0" rowspan="2"> - <widget class="QTabWidget" name="tabWidget_2"> + <widget class="QTabWidget" name="ftbTabWidget"> <property name="sizePolicy"> <sizepolicy hsizetype="Preferred" vsizetype="Expanding"> <horstretch>0</horstretch> @@ -74,37 +74,35 @@ <attribute name="title"> <string>Public Packs</string> </attribute> - <widget class="QTreeView" name="publicPackList"> - <property name="geometry"> - <rect> - <x>0</x> - <y>0</y> - <width>221</width> - <height>491</height> - </rect> - </property> - <property name="verticalScrollBarPolicy"> - <enum>Qt::ScrollBarAlwaysOn</enum> - </property> - </widget> + <layout class="QVBoxLayout" name="verticalLayout_2"> + <item> + <widget class="QTreeView" name="publicPackList"> + <property name="verticalScrollBarPolicy"> + <enum>Qt::ScrollBarAsNeeded</enum> + </property> + <property name="horizontalScrollBarPolicy"> + <enum>Qt::ScrollBarAlwaysOff</enum> + </property> + </widget> + </item> + </layout> </widget> <widget class="QWidget" name="tab_3"> <attribute name="title"> <string>3rd Party Packs</string> </attribute> - <widget class="QTreeView" name="thirdPartyPackList"> - <property name="geometry"> - <rect> - <x>0</x> - <y>0</y> - <width>221</width> - <height>491</height> - </rect> - </property> - <property name="verticalScrollBarPolicy"> - <enum>Qt::ScrollBarAlwaysOn</enum> - </property> - </widget> + <layout class="QVBoxLayout" name="verticalLayout_3"> + <item> + <widget class="QTreeView" name="thirdPartyPackList"> + <property name="verticalScrollBarPolicy"> + <enum>Qt::ScrollBarAsNeeded</enum> + </property> + <property name="horizontalScrollBarPolicy"> + <enum>Qt::ScrollBarAlwaysOff</enum> + </property> + </widget> + </item> + </layout> </widget> </widget> </item> |