mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-02-26 18:41:01 +00:00
Fix repeated subscriptions on layer wrapping type change.
This commit is contained in:
parent
8035fe8771
commit
7fb99319bb
@ -244,7 +244,7 @@ int LayerWidget::MinimalSupportedWidth() {
|
||||
}
|
||||
|
||||
int LayerWidget::resizeGetHeight(int newWidth) {
|
||||
if (!parentWidget() || !_content) {
|
||||
if (!parentWidget() || !_content || !newWidth) {
|
||||
return 0;
|
||||
}
|
||||
constexpr auto kMaxAttempts = 16;
|
||||
|
@ -46,14 +46,16 @@ void SectionWidget::init() {
|
||||
rpl::combine(
|
||||
sizeValue(),
|
||||
_content->desiredHeightValue()
|
||||
) | rpl::start_with_next([wrap = _content.data()](QSize size, int) {
|
||||
) | rpl::filter([=] {
|
||||
return (_content != nullptr);
|
||||
}) | rpl::start_with_next([=](QSize size, int) {
|
||||
const auto expanding = false;
|
||||
const auto additionalScroll = st::boxRadius;
|
||||
const auto full = !wrap->scrollBottomSkip();
|
||||
const auto full = !_content->scrollBottomSkip();
|
||||
const auto height = size.height() - (full ? 0 : st::boxRadius);
|
||||
const auto wrapGeometry = QRect{ 0, 0, size.width(), height };
|
||||
wrap->updateGeometry(wrapGeometry, expanding, additionalScroll);
|
||||
}, _content->lifetime());
|
||||
_content->updateGeometry(wrapGeometry, expanding, additionalScroll);
|
||||
}, lifetime());
|
||||
|
||||
_connecting = std::make_unique<Window::ConnectionState>(
|
||||
_content.data(),
|
||||
|
Loading…
Reference in New Issue
Block a user