mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-06 15:13:57 +02:00
Allow layers with fixed-bottom to stick-to-bottom.
This commit is contained in:
parent
ff030d0252
commit
62f42eabb0
4 changed files with 2 additions and 21 deletions
|
@ -280,7 +280,6 @@ QRect LayerWidget::countGeometry(int newWidth) {
|
||||||
st::infoLayerTopMaximal);
|
st::infoLayerTopMaximal);
|
||||||
const auto newBottom = newTop;
|
const auto newBottom = newTop;
|
||||||
|
|
||||||
const auto hasCustomBottomBar = _content->hasCustomBottomBar();
|
|
||||||
const auto bottomRadius = st::boxRadius;
|
const auto bottomRadius = st::boxRadius;
|
||||||
// Top rounding is included in _contentHeight.
|
// Top rounding is included in _contentHeight.
|
||||||
auto desiredHeight = _contentHeight + bottomRadius;
|
auto desiredHeight = _contentHeight + bottomRadius;
|
||||||
|
@ -293,9 +292,7 @@ QRect LayerWidget::countGeometry(int newWidth) {
|
||||||
const auto contentWidth = newWidth;
|
const auto contentWidth = newWidth;
|
||||||
auto contentHeight = desiredHeight - contentTop - contentBottom;
|
auto contentHeight = desiredHeight - contentTop - contentBottom;
|
||||||
const auto scrollTillBottom = _content->scrollTillBottom(contentHeight);
|
const auto scrollTillBottom = _content->scrollTillBottom(contentHeight);
|
||||||
auto additionalScroll = hasCustomBottomBar
|
auto additionalScroll = std::min(scrollTillBottom, newBottom);
|
||||||
? 0
|
|
||||||
: std::min(scrollTillBottom, newBottom);
|
|
||||||
|
|
||||||
const auto expanding = (_desiredHeight > _contentHeight);
|
const auto expanding = (_desiredHeight > _contentHeight);
|
||||||
|
|
||||||
|
|
|
@ -816,10 +816,6 @@ QPixmap WrapWidget::grabForShowAnimation(
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool WrapWidget::hasCustomBottomBar() const {
|
|
||||||
return _content->scrollBottomSkip() > 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
void WrapWidget::showAnimatedHook(
|
void WrapWidget::showAnimatedHook(
|
||||||
const Window::SectionSlideParams ¶ms) {
|
const Window::SectionSlideParams ¶ms) {
|
||||||
//if (params.withTabs && _topTabs) {
|
//if (params.withTabs && _topTabs) {
|
||||||
|
|
|
@ -100,8 +100,6 @@ public:
|
||||||
QPixmap grabForShowAnimation(
|
QPixmap grabForShowAnimation(
|
||||||
const Window::SectionSlideParams ¶ms) override;
|
const Window::SectionSlideParams ¶ms) override;
|
||||||
|
|
||||||
[[nodiscard]] bool hasCustomBottomBar() const;
|
|
||||||
|
|
||||||
void forceContentRepaint();
|
void forceContentRepaint();
|
||||||
|
|
||||||
bool showInternal(
|
bool showInternal(
|
||||||
|
|
|
@ -550,17 +550,7 @@ QPointer<Ui::RpWidget> Premium::createPinnedToBottom(
|
||||||
st::premiumPreviewBox.button.textTop,
|
st::premiumPreviewBox.button.textTop,
|
||||||
outer);
|
outer);
|
||||||
}, label->lifetime());
|
}, label->lifetime());
|
||||||
auto padding = st::settingsPremiumButtonPadding;
|
content->add(std::move(result), st::settingsPremiumButtonPadding);
|
||||||
const auto paddingBottom = padding.bottom();
|
|
||||||
padding.setBottom(paddingBottom - st::boxRadius);
|
|
||||||
content->add(std::move(result), padding);
|
|
||||||
|
|
||||||
content->add(
|
|
||||||
object_ptr<Ui::SlideWrap<Ui::FixedHeightWidget>>(
|
|
||||||
content,
|
|
||||||
object_ptr<Ui::FixedHeightWidget>(content, st::boxRadius))
|
|
||||||
)->setDuration(0)->toggleOn(_wrap.value(
|
|
||||||
) | rpl::map(rpl::mappers::_1 != Info::Wrap::Layer));
|
|
||||||
|
|
||||||
return Ui::MakeWeak(not_null<Ui::RpWidget*>{ content });
|
return Ui::MakeWeak(not_null<Ui::RpWidget*>{ content });
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue