2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 06:35:14 +00:00

Use different indentation for rpl operators.

It works better with Visual Studio IDE.
This commit is contained in:
John Preston
2017-12-22 11:05:20 +04:00
parent 44014e62ba
commit 8e45b09083
72 changed files with 1282 additions and 1237 deletions

View File

@@ -73,21 +73,22 @@ WrapWidget::WrapWidget(
, _wrap(wrap)
, _controller(createController(window, memento->content()))
, _topShadow(this) {
_topShadow->toggleOn(topShadowToggledValue()
| rpl::filter([](bool shown) {
_topShadow->toggleOn(
topShadowToggledValue(
) | rpl::filter([](bool shown) {
return true;
}));
_wrap.changes()
| rpl::start_with_next([this] {
setupTop();
finishShowContent();
}, lifetime());
selectedListValue()
| rpl::start_with_next([this](SelectedItems &&items) {
InvokeQueued(this, [this, items = std::move(items)]() mutable {
if (_topBar) _topBar->setSelectedItems(std::move(items));
});
}, lifetime());
_wrap.changes(
) | rpl::start_with_next([this] {
setupTop();
finishShowContent();
}, lifetime());
selectedListValue(
) | rpl::start_with_next([this](SelectedItems &&items) {
InvokeQueued(this, [this, items = std::move(items)]() mutable {
if (_topBar) _topBar->setSelectedItems(std::move(items));
});
}, lifetime());
restoreHistoryStack(memento->takeStack());
}
@@ -116,12 +117,14 @@ void WrapWidget::startInjectingActivePeerProfiles() {
using namespace rpl::mappers;
rpl::combine(
_wrap.value(),
_controller->parentController()->activePeer.value())
| rpl::filter((_1 == Wrap::Side) && (_2 != nullptr))
| rpl::map(_2)
| rpl::start_with_next([this](not_null<PeerData*> peer) {
injectActivePeerProfile(peer);
}, lifetime());
_controller->parentController()->activePeer.value()
) | rpl::filter(
(_1 == Wrap::Side) && (_2 != nullptr)
) | rpl::map(
_2
) | rpl::start_with_next([this](not_null<PeerData*> peer) {
injectActivePeerProfile(peer);
}, lifetime());
}
@@ -190,11 +193,12 @@ not_null<PeerData*> WrapWidget::peer() const {
// _topTabs->setActiveSection(static_cast<int>(_tab));
// _topTabs->finishAnimating();
//
// _topTabs->sectionActivated()
// | rpl::map([](int index) { return static_cast<Tab>(index); })
// | rpl::start_with_next(
// [this](Tab tab) { showTab(tab); },
// lifetime());
// _topTabs->sectionActivated(
// ) | rpl::map([](int index) {
// return static_cast<Tab>(index);
// }) | rpl::start_with_next(
// [this](Tab tab) { showTab(tab); },
// lifetime());
//
// _topTabs->move(0, 0);
// _topTabs->resizeToWidth(width());
@@ -310,10 +314,10 @@ void WrapWidget::createTopBar() {
? _topBar->takeSelectedItems()
: SelectedItems(Section::MediaType::kCount);
_topBar.create(this, TopBarStyle(wrapValue), std::move(selectedItems));
_topBar->cancelSelectionRequests()
| rpl::start_with_next([this](auto) {
_content->cancelSelection();
}, _topBar->lifetime());
_topBar->cancelSelectionRequests(
) | rpl::start_with_next([this] {
_content->cancelSelection();
}, _topBar->lifetime());
_topBar->setTitle(TitleValue(
_controller->section(),
@@ -321,10 +325,10 @@ void WrapWidget::createTopBar() {
!hasStackHistory()));
if (wrapValue == Wrap::Narrow || hasStackHistory()) {
_topBar->enableBackButton();
_topBar->backRequest()
| rpl::start_with_next([this] {
_controller->showBackFromStack();
}, _topBar->lifetime());
_topBar->backRequest(
) | rpl::start_with_next([this] {
_controller->showBackFromStack();
}, _topBar->lifetime());
} else if (wrapValue == Wrap::Side) {
auto close = _topBar->addButton(
base::make_unique_q<Ui::IconButton>(
@@ -425,17 +429,18 @@ void WrapWidget::addProfileNotificationsButton() {
: Data::NotifySettings::MuteChange::Mute;
App::main()->updateNotifySettings(peer, muteState);
});
Profile::NotificationsEnabledValue(peer)
| rpl::start_with_next([notifications](bool enabled) {
const auto iconOverride = enabled
? &st::infoNotificationsActive
: nullptr;
const auto rippleOverride = enabled
? &st::lightButtonBgOver
: nullptr;
notifications->setIconOverride(iconOverride, iconOverride);
notifications->setRippleColorOverride(rippleOverride);
}, notifications->lifetime());
Profile::NotificationsEnabledValue(
peer
) | rpl::start_with_next([notifications](bool enabled) {
const auto iconOverride = enabled
? &st::infoNotificationsActive
: nullptr;
const auto rippleOverride = enabled
? &st::lightButtonBgOver
: nullptr;
notifications->setIconOverride(iconOverride, iconOverride);
notifications->setRippleColorOverride(rippleOverride);
}, notifications->lifetime());
}
void WrapWidget::showProfileMenu() {