mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Fix repeated subscriptions on layer wrapping type change.
This commit is contained in:
parent
8035fe8771
commit
7fb99319bb
2 changed files with 7 additions and 5 deletions
|
@ -244,7 +244,7 @@ int LayerWidget::MinimalSupportedWidth() {
|
||||||
}
|
}
|
||||||
|
|
||||||
int LayerWidget::resizeGetHeight(int newWidth) {
|
int LayerWidget::resizeGetHeight(int newWidth) {
|
||||||
if (!parentWidget() || !_content) {
|
if (!parentWidget() || !_content || !newWidth) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
constexpr auto kMaxAttempts = 16;
|
constexpr auto kMaxAttempts = 16;
|
||||||
|
|
|
@ -46,14 +46,16 @@ void SectionWidget::init() {
|
||||||
rpl::combine(
|
rpl::combine(
|
||||||
sizeValue(),
|
sizeValue(),
|
||||||
_content->desiredHeightValue()
|
_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 expanding = false;
|
||||||
const auto additionalScroll = st::boxRadius;
|
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 height = size.height() - (full ? 0 : st::boxRadius);
|
||||||
const auto wrapGeometry = QRect{ 0, 0, size.width(), height };
|
const auto wrapGeometry = QRect{ 0, 0, size.width(), height };
|
||||||
wrap->updateGeometry(wrapGeometry, expanding, additionalScroll);
|
_content->updateGeometry(wrapGeometry, expanding, additionalScroll);
|
||||||
}, _content->lifetime());
|
}, lifetime());
|
||||||
|
|
||||||
_connecting = std::make_unique<Window::ConnectionState>(
|
_connecting = std::make_unique<Window::ConnectionState>(
|
||||||
_content.data(),
|
_content.data(),
|
||||||
|
|
Loading…
Add table
Reference in a new issue