mirror of https://github.com/procxx/kepka.git
Workaround MSVC 15.8 regressions.
This commit is contained in:
parent
f76a2bc224
commit
fddc3d6ad9
|
@ -127,15 +127,16 @@ Ui::RpWidget *ContentWidget::doSetInnerWidget(
|
||||||
_innerWrap ? _innerWrap->padding() : style::margins()));
|
_innerWrap ? _innerWrap->padding() : style::margins()));
|
||||||
_innerWrap->move(0, 0);
|
_innerWrap->move(0, 0);
|
||||||
|
|
||||||
|
// MSVC BUG + REGRESSION rpl::mappers::tuple :(
|
||||||
rpl::combine(
|
rpl::combine(
|
||||||
_scroll->scrollTopValue(),
|
_scroll->scrollTopValue(),
|
||||||
_scroll->heightValue(),
|
_scroll->heightValue(),
|
||||||
_innerWrap->entity()->desiredHeightValue(),
|
_innerWrap->entity()->desiredHeightValue()
|
||||||
tuple(_1, _1 + _2, _3)
|
|
||||||
) | rpl::start_with_next([this](
|
) | rpl::start_with_next([this](
|
||||||
int top,
|
int top,
|
||||||
int bottom,
|
int height,
|
||||||
int desired) {
|
int desired) {
|
||||||
|
const auto bottom = top + height;
|
||||||
_innerDesiredHeight = desired;
|
_innerDesiredHeight = desired;
|
||||||
_innerWrap->setVisibleTopBottom(top, bottom);
|
_innerWrap->setVisibleTopBottom(top, bottom);
|
||||||
_scrollTillBottomChanges.fire_copy(std::max(desired - bottom, 0));
|
_scrollTillBottomChanges.fire_copy(std::max(desired - bottom, 0));
|
||||||
|
|
|
@ -296,6 +296,7 @@ MainWidget::MainWidget(
|
||||||
checkFloatPlayerVisibility();
|
checkFloatPlayerVisibility();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// MSVC BUG + REGRESSION rpl::mappers::tuple :(
|
||||||
using namespace rpl::mappers;
|
using namespace rpl::mappers;
|
||||||
_controller->activeChatValue(
|
_controller->activeChatValue(
|
||||||
) | rpl::map([](Dialogs::Key key) {
|
) | rpl::map([](Dialogs::Key key) {
|
||||||
|
@ -303,7 +304,11 @@ MainWidget::MainWidget(
|
||||||
auto canWrite = peer
|
auto canWrite = peer
|
||||||
? Data::CanWriteValue(peer)
|
? Data::CanWriteValue(peer)
|
||||||
: rpl::single(false);
|
: rpl::single(false);
|
||||||
return std::move(canWrite) | rpl::map(tuple(key, _1));
|
return std::move(
|
||||||
|
canWrite
|
||||||
|
) | rpl::map([=](bool can) {
|
||||||
|
return std::make_tuple(key, can);
|
||||||
|
});
|
||||||
}) | rpl::flatten_latest(
|
}) | rpl::flatten_latest(
|
||||||
) | rpl::start_with_next([this](Dialogs::Key key, bool canWrite) {
|
) | rpl::start_with_next([this](Dialogs::Key key, bool canWrite) {
|
||||||
updateThirdColumnToCurrentChat(key, canWrite);
|
updateThirdColumnToCurrentChat(key, canWrite);
|
||||||
|
|
|
@ -301,12 +301,13 @@ void Panel::refreshList() {
|
||||||
_scroll->scrollToY(newScrollTop);
|
_scroll->scrollToY(newScrollTop);
|
||||||
}, weak->lifetime());
|
}, weak->lifetime());
|
||||||
|
|
||||||
|
// MSVC BUG + REGRESSION rpl::mappers::tuple :(
|
||||||
using namespace rpl::mappers;
|
using namespace rpl::mappers;
|
||||||
rpl::combine(
|
rpl::combine(
|
||||||
_scroll->scrollTopValue(),
|
_scroll->scrollTopValue(),
|
||||||
_scroll->heightValue(),
|
_scroll->heightValue()
|
||||||
tuple(_1, _1 + _2)
|
) | rpl::start_with_next([=](int top, int height) {
|
||||||
) | rpl::start_with_next([=](int top, int bottom) {
|
const auto bottom = top + height;
|
||||||
weak->setVisibleTopBottom(top, bottom);
|
weak->setVisibleTopBottom(top, bottom);
|
||||||
}, weak->lifetime());
|
}, weak->lifetime());
|
||||||
|
|
||||||
|
|
|
@ -367,6 +367,15 @@ TEST_CASE("basic operators tests", "[rpl::operators]") {
|
||||||
|
|
||||||
using namespace mappers;
|
using namespace mappers;
|
||||||
|
|
||||||
|
// MSVC BUG + REGRESSION rpl::mappers::tuple :(
|
||||||
|
//combine(
|
||||||
|
// a.events(),
|
||||||
|
// b.events(),
|
||||||
|
// tuple(_1, _1 + _2)
|
||||||
|
//) | rpl::start_with_next([=](int a, int a_plus_b) {
|
||||||
|
// *sum += std::to_string(a * a_plus_b);
|
||||||
|
//}, lifetime);
|
||||||
|
|
||||||
combine(
|
combine(
|
||||||
a.events(),
|
a.events(),
|
||||||
b.events(),
|
b.events(),
|
||||||
|
@ -384,6 +393,9 @@ TEST_CASE("basic operators tests", "[rpl::operators]") {
|
||||||
c.fire(6);
|
c.fire(6);
|
||||||
}
|
}
|
||||||
REQUIRE(*sum == "16192225");
|
REQUIRE(*sum == "16192225");
|
||||||
|
|
||||||
|
// MSVC BUG + REGRESSION rpl::mappers::tuple :(
|
||||||
|
//REQUIRE(*sum == "3162419362225");
|
||||||
}
|
}
|
||||||
|
|
||||||
SECTION("after_next test") {
|
SECTION("after_next test") {
|
||||||
|
|
|
@ -43,7 +43,7 @@ public:
|
||||||
_clickedCallback = std::move(callback);
|
_clickedCallback = std::move(callback);
|
||||||
}
|
}
|
||||||
|
|
||||||
auto clicks() const {
|
rpl::producer<> clicks() const {
|
||||||
return _clicks.events();
|
return _clicks.events();
|
||||||
}
|
}
|
||||||
template <typename Handler>
|
template <typename Handler>
|
||||||
|
|
Loading…
Reference in New Issue