mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-01-27 23:14:31 +00:00
Fix column size too narrow on resize
Instead of giving a value, just resize to the content size
This commit is contained in:
parent
27cf98a962
commit
c2c0dd2717
@ -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();
|
||||
}
|
||||
|
@ -79,9 +79,6 @@ PluginSelectDlg::PluginSelectDlg(SearchEngine *pluginManager, QWidget *parent)
|
||||
unused.setVerticalHeader(new QHeaderView(Qt::Horizontal));
|
||||
|
||||
m_ui->pluginsTree->setRootIsDecorated(false);
|
||||
m_ui->pluginsTree->header()->resizeSection(0, 160);
|
||||
m_ui->pluginsTree->header()->resizeSection(1, 80);
|
||||
m_ui->pluginsTree->header()->resizeSection(2, 200);
|
||||
m_ui->pluginsTree->hideColumn(PLUGIN_ID);
|
||||
m_ui->pluginsTree->header()->setSortIndicator(0, Qt::AscendingOrder);
|
||||
|
||||
|
@ -334,10 +334,9 @@ void SearchTab::displayToggleColumnsMenu(const QPoint&)
|
||||
Q_ASSERT(visibleCols > 0);
|
||||
if ((!m_ui->resultsBrowser->isColumnHidden(col)) && (visibleCols == 1))
|
||||
return;
|
||||
qDebug("Toggling column %d visibility", col);
|
||||
m_ui->resultsBrowser->setColumnHidden(col, !m_ui->resultsBrowser->isColumnHidden(col));
|
||||
if ((!m_ui->resultsBrowser->isColumnHidden(col)) && (m_ui->resultsBrowser->columnWidth(col) <= 5))
|
||||
m_ui->resultsBrowser->setColumnWidth(col, 100);
|
||||
m_ui->resultsBrowser->resizeColumnToContents(col);
|
||||
saveSettings();
|
||||
}
|
||||
}
|
||||
|
@ -716,10 +716,9 @@ void TransferListWidget::displayDLHoSMenu(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();
|
||||
}
|
||||
}
|
||||
@ -1193,10 +1192,7 @@ void TransferListWidget::saveSettings()
|
||||
|
||||
bool TransferListWidget::loadSettings()
|
||||
{
|
||||
bool ok = header()->restoreState(Preferences::instance()->getTransHeaderState());
|
||||
if (!ok)
|
||||
header()->resizeSection(0, 200); // Default
|
||||
return ok;
|
||||
return header()->restoreState(Preferences::instance()->getTransHeaderState());
|
||||
}
|
||||
|
||||
void TransferListWidget::wheelEvent(QWheelEvent *event)
|
||||
|
Loading…
x
Reference in New Issue
Block a user