2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-10-13 13:58:04 +00:00

Add rpl::take(count).

This commit is contained in:
John Preston
2017-10-01 12:39:07 +03:00
parent f0ad78d808
commit c4d33f9986
9 changed files with 135 additions and 18 deletions

View File

@@ -20,8 +20,20 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
*/
#include "ui/abstract_button.h"
#include <rpl/filter.h>
#include <rpl/mappers.h>
namespace Ui {
AbstractButton::AbstractButton(QWidget *parent) : RpWidget(parent) {
setMouseTracking(true);
using namespace rpl::mappers;
shownValue()
| rpl::filter($1 == false)
| rpl::start_with_next([this] { clearState(); }, lifetime());
}
void AbstractButton::leaveEventHook(QEvent *e) {
if (_state & StateFlag::Down) return;