2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-09-05 08:55:59 +00:00

Use rpl in some widgets and effects.

This commit is contained in:
John Preston
2017-09-13 19:57:44 +03:00
parent 21d136e224
commit c302219f9e
120 changed files with 2119 additions and 671 deletions

View File

@@ -285,7 +285,7 @@ void TabbedSelector::Tab::saveScrollTop() {
_scrollTop = widget()->getVisibleTop();
}
TabbedSelector::TabbedSelector(QWidget *parent, not_null<Window::Controller*> controller) : TWidget(parent)
TabbedSelector::TabbedSelector(QWidget *parent, not_null<Window::Controller*> controller) : RpWidget(parent)
, _tabsSlider(this, st::emojiTabs)
, _topShadow(this, st::shadowFg)
, _bottomShadow(this, st::shadowFg)
@@ -472,7 +472,7 @@ bool TabbedSelector::wheelEventFromFloatPlayer(QEvent *e) {
return _scroll->viewportEvent(e);
}
QRect TabbedSelector::rectForFloatPlayer() {
QRect TabbedSelector::rectForFloatPlayer() const {
return mapToGlobal(_scroll->geometry());
}
@@ -602,9 +602,9 @@ void TabbedSelector::createTabsSlider() {
_tabsSlider->setSections(sections);
_tabsSlider->setActiveSectionFast(static_cast<int>(_currentTabType));
_tabsSlider->setSectionActivatedCallback([this] {
switchTab();
});
_tabsSlider->sectionActivated()
| rpl::on_next([this](int) { switchTab(); })
| rpl::start(lifetime());
_tabsSlider->resizeToWidth(width());
_tabsSlider->moveToLeft(0, 0);
@@ -701,7 +701,7 @@ TabbedSelector::Inner::Inner(QWidget *parent, not_null<Window::Controller*> cont
, _controller(controller) {
}
void TabbedSelector::Inner::setVisibleTopBottom(int visibleTop, int visibleBottom) {
void TabbedSelector::Inner::visibleTopBottomUpdated(int visibleTop, int visibleBottom) {
auto oldVisibleHeight = getVisibleBottom() - getVisibleTop();
_visibleTop = visibleTop;
_visibleBottom = visibleBottom;