mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-12 08:16:16 -07:00
Align Properties tab bar correctly on window resize
This commit is contained in:
parent
a7bd68a2c7
commit
6258c1e65b
1 changed files with 4 additions and 1 deletions
|
@ -194,13 +194,15 @@ void PropertiesWidget::showPiecesDownloaded(bool show)
|
||||||
void PropertiesWidget::setVisibility(bool visible)
|
void PropertiesWidget::setVisibility(bool visible)
|
||||||
{
|
{
|
||||||
if (!visible && (m_state == VISIBLE)) {
|
if (!visible && (m_state == VISIBLE)) {
|
||||||
|
const int tabBarHeight = m_tabBar->geometry().height(); // take height before hiding
|
||||||
auto *hSplitter = static_cast<QSplitter *>(parentWidget());
|
auto *hSplitter = static_cast<QSplitter *>(parentWidget());
|
||||||
m_ui->stackedProperties->setVisible(false);
|
m_ui->stackedProperties->setVisible(false);
|
||||||
m_slideSizes = hSplitter->sizes();
|
m_slideSizes = hSplitter->sizes();
|
||||||
hSplitter->handle(1)->setVisible(false);
|
hSplitter->handle(1)->setVisible(false);
|
||||||
hSplitter->handle(1)->setDisabled(true);
|
hSplitter->handle(1)->setDisabled(true);
|
||||||
QList<int> sizes = QList<int>() << hSplitter->geometry().height() - 30 << 30;
|
const QList<int> sizes {(hSplitter->geometry().height() - tabBarHeight), tabBarHeight};
|
||||||
hSplitter->setSizes(sizes);
|
hSplitter->setSizes(sizes);
|
||||||
|
setMaximumSize(maximumSize().width(), tabBarHeight);
|
||||||
m_state = REDUCED;
|
m_state = REDUCED;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -212,6 +214,7 @@ void PropertiesWidget::setVisibility(bool visible)
|
||||||
hSplitter->handle(1)->setVisible(true);
|
hSplitter->handle(1)->setVisible(true);
|
||||||
hSplitter->setSizes(m_slideSizes);
|
hSplitter->setSizes(m_slideSizes);
|
||||||
m_state = VISIBLE;
|
m_state = VISIBLE;
|
||||||
|
setMaximumSize(maximumSize().width(), QWIDGETSIZE_MAX);
|
||||||
// Force refresh
|
// Force refresh
|
||||||
loadDynamicData();
|
loadDynamicData();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue