diff options
| author | LostDragonist <lost.dragonist@gmail.com> | 2018-12-14 17:26:37 -0600 |
|---|---|---|
| committer | LostDragonist <lost.dragonist@gmail.com> | 2018-12-20 20:57:09 -0600 |
| commit | 70ddfaadbfdf3999eea0fe50f7cdac3675e5f019 (patch) | |
| tree | e2c6117585afa759dcb22e9421bfba3622b24a2b /src/mainwindow.cpp | |
| parent | afdd21440aa761e023f0ed991a75e318ad8298b7 (diff) | |
Expand mod list search edit to work on categories, nexus IDs, and notes
Diffstat (limited to 'src/mainwindow.cpp')
| -rw-r--r-- | src/mainwindow.cpp | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 3b7fa917..44381864 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -285,14 +285,17 @@ MainWindow::MainWindow(QSettings &initSettings ui->modList->setItemDelegateForColumn(ModList::COL_FLAGS, new ModFlagIconDelegate(ui->modList));
ui->modList->setItemDelegateForColumn(ModList::COL_CONTENT, contentDelegate);
ui->modList->header()->installEventFilter(m_OrganizerCore.modList());
+ connect(ui->modList->header(), SIGNAL(sectionResized(int, int, int)), this, SLOT(modListSectionResized(int, int, int)));
bool modListAdjusted = registerWidgetState(ui->modList->objectName(), ui->modList->header(), "mod_list_state");
if (modListAdjusted) {
// hack: force the resize-signal to be triggered because restoreState doesn't seem to do that
- int sectionSize = ui->modList->header()->sectionSize(ModList::COL_CONTENT);
- ui->modList->header()->resizeSection(ModList::COL_CONTENT, sectionSize + 1);
- ui->modList->header()->resizeSection(ModList::COL_CONTENT, sectionSize);
+ for (int column = 0; column <= ModList::COL_LASTCOLUMN; ++column) {
+ int sectionSize = ui->modList->header()->sectionSize(column);
+ ui->modList->header()->resizeSection(column, sectionSize + 1);
+ ui->modList->header()->resizeSection(column, sectionSize);
+ }
} else {
// hide these columns by default
ui->modList->header()->setSectionHidden(ModList::COL_CONTENT, true);
@@ -2474,6 +2477,12 @@ void MainWindow::modListSortIndicatorChanged(int, Qt::SortOrder) ui->modList->verticalScrollBar()->repaint();
}
+void MainWindow::modListSectionResized(int logicalIndex, int oldSize, int newSize)
+{
+ bool enabled = (newSize != 0);
+ qobject_cast<ModListSortProxy *>(ui->modList->model())->setColumnVisible(logicalIndex, enabled);
+}
+
void MainWindow::removeMod_clicked()
{
try {
|
