mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-01-29 16:04:21 +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);
|
Q_ASSERT(visibleCols > 0);
|
||||||
if (!isColumnHidden(col) && (visibleCols == 1))
|
if (!isColumnHidden(col) && (visibleCols == 1))
|
||||||
return;
|
return;
|
||||||
qDebug("Toggling column %d visibility", col);
|
|
||||||
setColumnHidden(col, !isColumnHidden(col));
|
setColumnHidden(col, !isColumnHidden(col));
|
||||||
if (!isColumnHidden(col) && (columnWidth(col) <= 5))
|
if (!isColumnHidden(col) && (columnWidth(col) <= 5))
|
||||||
setColumnWidth(col, 100);
|
resizeColumnToContents(col);
|
||||||
saveSettings();
|
saveSettings();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -371,9 +371,7 @@ void PropertiesWidget::readSettings()
|
|||||||
}
|
}
|
||||||
const int current_tab = pref->getPropCurTab();
|
const int current_tab = pref->getPropCurTab();
|
||||||
const bool visible = pref->getPropVisible();
|
const bool visible = pref->getPropVisible();
|
||||||
// the following will call saveSettings but shouldn't change any state
|
m_ui->filesList->header()->restoreState(pref->getPropFileListState());
|
||||||
if (!m_ui->filesList->header()->restoreState(pref->getPropFileListState()))
|
|
||||||
m_ui->filesList->header()->resizeSection(0, 400); // Default
|
|
||||||
m_tabBar->setCurrentIndex(current_tab);
|
m_tabBar->setCurrentIndex(current_tab);
|
||||||
if (!visible)
|
if (!visible)
|
||||||
setVisibility(false);
|
setVisibility(false);
|
||||||
|
@ -627,9 +627,8 @@ void TrackerList::displayToggleColumnsMenu(const QPoint &)
|
|||||||
Q_ASSERT(visibleColumnsCount() > 0);
|
Q_ASSERT(visibleColumnsCount() > 0);
|
||||||
if (!isColumnHidden(col) && (visibleColumnsCount() == 1))
|
if (!isColumnHidden(col) && (visibleColumnsCount() == 1))
|
||||||
return;
|
return;
|
||||||
qDebug("Toggling column %d visibility", col);
|
|
||||||
setColumnHidden(col, !isColumnHidden(col));
|
setColumnHidden(col, !isColumnHidden(col));
|
||||||
if (!isColumnHidden(col) && (columnWidth(col) <= 5))
|
if (!isColumnHidden(col) && (columnWidth(col) <= 5))
|
||||||
setColumnWidth(col, 100);
|
resizeColumnToContents(col);
|
||||||
saveSettings();
|
saveSettings();
|
||||||
}
|
}
|
||||||
|
@ -79,9 +79,6 @@ PluginSelectDlg::PluginSelectDlg(SearchEngine *pluginManager, QWidget *parent)
|
|||||||
unused.setVerticalHeader(new QHeaderView(Qt::Horizontal));
|
unused.setVerticalHeader(new QHeaderView(Qt::Horizontal));
|
||||||
|
|
||||||
m_ui->pluginsTree->setRootIsDecorated(false);
|
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->hideColumn(PLUGIN_ID);
|
||||||
m_ui->pluginsTree->header()->setSortIndicator(0, Qt::AscendingOrder);
|
m_ui->pluginsTree->header()->setSortIndicator(0, Qt::AscendingOrder);
|
||||||
|
|
||||||
|
@ -334,10 +334,9 @@ void SearchTab::displayToggleColumnsMenu(const QPoint&)
|
|||||||
Q_ASSERT(visibleCols > 0);
|
Q_ASSERT(visibleCols > 0);
|
||||||
if ((!m_ui->resultsBrowser->isColumnHidden(col)) && (visibleCols == 1))
|
if ((!m_ui->resultsBrowser->isColumnHidden(col)) && (visibleCols == 1))
|
||||||
return;
|
return;
|
||||||
qDebug("Toggling column %d visibility", col);
|
|
||||||
m_ui->resultsBrowser->setColumnHidden(col, !m_ui->resultsBrowser->isColumnHidden(col));
|
m_ui->resultsBrowser->setColumnHidden(col, !m_ui->resultsBrowser->isColumnHidden(col));
|
||||||
if ((!m_ui->resultsBrowser->isColumnHidden(col)) && (m_ui->resultsBrowser->columnWidth(col) <= 5))
|
if ((!m_ui->resultsBrowser->isColumnHidden(col)) && (m_ui->resultsBrowser->columnWidth(col) <= 5))
|
||||||
m_ui->resultsBrowser->setColumnWidth(col, 100);
|
m_ui->resultsBrowser->resizeColumnToContents(col);
|
||||||
saveSettings();
|
saveSettings();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -716,10 +716,9 @@ void TransferListWidget::displayDLHoSMenu(const QPoint&)
|
|||||||
Q_ASSERT(visibleCols > 0);
|
Q_ASSERT(visibleCols > 0);
|
||||||
if (!isColumnHidden(col) && visibleCols == 1)
|
if (!isColumnHidden(col) && visibleCols == 1)
|
||||||
return;
|
return;
|
||||||
qDebug("Toggling column %d visibility", col);
|
|
||||||
setColumnHidden(col, !isColumnHidden(col));
|
setColumnHidden(col, !isColumnHidden(col));
|
||||||
if (!isColumnHidden(col) && columnWidth(col) <= 5)
|
if (!isColumnHidden(col) && columnWidth(col) <= 5)
|
||||||
setColumnWidth(col, 100);
|
resizeColumnToContents(col);
|
||||||
saveSettings();
|
saveSettings();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1193,10 +1192,7 @@ void TransferListWidget::saveSettings()
|
|||||||
|
|
||||||
bool TransferListWidget::loadSettings()
|
bool TransferListWidget::loadSettings()
|
||||||
{
|
{
|
||||||
bool ok = header()->restoreState(Preferences::instance()->getTransHeaderState());
|
return header()->restoreState(Preferences::instance()->getTransHeaderState());
|
||||||
if (!ok)
|
|
||||||
header()->resizeSection(0, 200); // Default
|
|
||||||
return ok;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void TransferListWidget::wheelEvent(QWheelEvent *event)
|
void TransferListWidget::wheelEvent(QWheelEvent *event)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user