diff --git a/ui/layers/box_content.cpp b/ui/layers/box_content.cpp index 00ec1b6..fdaa06c 100644 --- a/ui/layers/box_content.cpp +++ b/ui/layers/box_content.cpp @@ -321,18 +321,20 @@ void BoxContent::updateInnerVisibleTopBottom() { } } -void BoxContent::updateShadowsVisibility() { +void BoxContent::updateShadowsVisibility(anim::type animated) { if (!_scroll) { return; } const auto top = _scroll->scrollTop(); _topShadow->toggle( - (top > 0 || _innerTopSkip > 0), - anim::type::normal); + ((top > 0) + || (_innerTopSkip > 0 + && !getDelegate()->style().shadowIgnoreTopSkip)), + animated); _bottomShadow->toggle( (top < _scroll->scrollTopMax() || _innerBottomSkip > 0), - anim::type::normal); + animated); } void BoxContent::setDimensionsToContent( @@ -419,14 +421,7 @@ void BoxContent::updateScrollAreaGeometry() { height() - _innerBottomSkip - st::lineWidth); if (changed) { updateInnerVisibleTopBottom(); - - const auto top = _scroll->scrollTop(); - _topShadow->toggle( - (top > 0 || _innerTopSkip > 0), - anim::type::instant); - _bottomShadow->toggle( - (top < _scroll->scrollTopMax() || _innerBottomSkip > 0), - anim::type::instant); + updateShadowsVisibility(anim::type::instant); } } diff --git a/ui/layers/box_content.h b/ui/layers/box_content.h index c5f31cd..d528bf1 100644 --- a/ui/layers/box_content.h +++ b/ui/layers/box_content.h @@ -294,7 +294,7 @@ private: void setInner(object_ptr inner, const style::ScrollArea &st); void updateScrollAreaGeometry(); void updateInnerVisibleTopBottom(); - void updateShadowsVisibility(); + void updateShadowsVisibility(anim::type animated = anim::type::normal); object_ptr doTakeInnerWidget(); BoxContentDelegate *_delegate = nullptr; diff --git a/ui/layers/layers.style b/ui/layers/layers.style index 814092a..1f7f897 100644 --- a/ui/layers/layers.style +++ b/ui/layers/layers.style @@ -29,6 +29,7 @@ Box { title: FlatLabel; bg: color; titleAdditionalFg: color; + shadowIgnoreTopSkip: bool; } boxDuration: 200;