mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-31 20:58:07 -06:00
Fix column size too narrow on resize
Instead of giving a value, just resize to the content size
This commit is contained in:
@@ -180,10 +180,9 @@ void PeerListWidget::displayToggleColumnsMenu(const QPoint &)
|
||||
Q_ASSERT(visibleCols > 0);
|
||||
if (!isColumnHidden(col) && (visibleCols == 1))
|
||||
return;
|
||||
qDebug("Toggling column %d visibility", col);
|
||||
setColumnHidden(col, !isColumnHidden(col));
|
||||
if (!isColumnHidden(col) && (columnWidth(col) <= 5))
|
||||
setColumnWidth(col, 100);
|
||||
resizeColumnToContents(col);
|
||||
saveSettings();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -371,9 +371,7 @@ void PropertiesWidget::readSettings()
|
||||
}
|
||||
const int current_tab = pref->getPropCurTab();
|
||||
const bool visible = pref->getPropVisible();
|
||||
// the following will call saveSettings but shouldn't change any state
|
||||
if (!m_ui->filesList->header()->restoreState(pref->getPropFileListState()))
|
||||
m_ui->filesList->header()->resizeSection(0, 400); // Default
|
||||
m_ui->filesList->header()->restoreState(pref->getPropFileListState());
|
||||
m_tabBar->setCurrentIndex(current_tab);
|
||||
if (!visible)
|
||||
setVisibility(false);
|
||||
|
||||
@@ -627,9 +627,8 @@ void TrackerList::displayToggleColumnsMenu(const QPoint &)
|
||||
Q_ASSERT(visibleColumnsCount() > 0);
|
||||
if (!isColumnHidden(col) && (visibleColumnsCount() == 1))
|
||||
return;
|
||||
qDebug("Toggling column %d visibility", col);
|
||||
setColumnHidden(col, !isColumnHidden(col));
|
||||
if (!isColumnHidden(col) && (columnWidth(col) <= 5))
|
||||
setColumnWidth(col, 100);
|
||||
resizeColumnToContents(col);
|
||||
saveSettings();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user