Allow pinned top box part without a shadow.
This commit is contained in:
parent
dc6a4e976c
commit
ae7409b062
3 changed files with 9 additions and 13 deletions
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -294,7 +294,7 @@ private:
|
|||
void setInner(object_ptr<TWidget> inner, const style::ScrollArea &st);
|
||||
void updateScrollAreaGeometry();
|
||||
void updateInnerVisibleTopBottom();
|
||||
void updateShadowsVisibility();
|
||||
void updateShadowsVisibility(anim::type animated = anim::type::normal);
|
||||
object_ptr<TWidget> doTakeInnerWidget();
|
||||
|
||||
BoxContentDelegate *_delegate = nullptr;
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@ Box {
|
|||
title: FlatLabel;
|
||||
bg: color;
|
||||
titleAdditionalFg: color;
|
||||
shadowIgnoreTopSkip: bool;
|
||||
}
|
||||
|
||||
boxDuration: 200;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue