- setEnabled(visible);
- if (m_heightAnimation) {
- m_heightAnimation->stop(); // deletes because of QAbstractAnimation::DeleteWhenStopped.
- }
- m_heightAnimation = new QPropertyAnimation(this, "maximumHeight");
- m_heightAnimation->setDuration(2 *
- style()->styleHint(QStyle::SH_Widget_Animation_Duration, nullptr, this) *
- GlobalConfig::animationDurationFactor());
- m_heightAnimation->setStartValue(height());
- m_heightAnimation->setEasingCurve(QEasingCurve::OutCubic);
- if (visible) {
- show();
- m_heightAnimation->setEndValue(sizeHint().height());
- connect(m_heightAnimation, &QAbstractAnimation::finished,
- this, [this](){ setMaximumHeight(sizeHint().height()); });
- } else {
- m_heightAnimation->setEndValue(0);
- connect(m_heightAnimation, &QAbstractAnimation::finished,
- this, &QWidget::hide);
- }
-
- m_heightAnimation->start(QAbstractAnimation::DeleteWhenStopped);
-}
-
-QSize BottomBar::sizeHint() const
-{
- return QSize{1, m_contentsContainer->sizeHint().height()};
- // 1 as width because this widget should never be the reason the DolphinViewContainer is made wider.