2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-09-01 15:05:56 +00:00

Start new Info section (profile + shared media).

This commit is contained in:
John Preston
2017-09-13 20:01:23 +03:00
parent fbcd5e2f1e
commit 088d23d557
80 changed files with 3969 additions and 63 deletions

View File

@@ -21,13 +21,19 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
#include "window/section_widget.h"
#include "application.h"
#include <rpl/single.h>
namespace Window {
SectionWidget::SectionWidget(QWidget *parent, not_null<Window::Controller*> controller) : AbstractSectionWidget(parent, controller) {
SectionWidget::SectionWidget(
QWidget *parent,
not_null<Window::Controller*> controller)
: AbstractSectionWidget(parent, controller) {
}
void SectionWidget::setGeometryWithTopMoved(const QRect &newGeometry, int topDelta) {
void SectionWidget::setGeometryWithTopMoved(
const QRect &newGeometry,
int topDelta) {
_topDelta = topDelta;
bool willBeResized = (size() != newGeometry.size());
if (geometry() != newGeometry) {
@@ -39,7 +45,9 @@ void SectionWidget::setGeometryWithTopMoved(const QRect &newGeometry, int topDel
_topDelta = 0;
}
void SectionWidget::showAnimated(SlideDirection direction, const SectionSlideParams &params) {
void SectionWidget::showAnimated(
SlideDirection direction,
const SectionSlideParams &params) {
if (_showAnimation) return;
showChildren();
@@ -51,7 +59,9 @@ void SectionWidget::showAnimated(SlideDirection direction, const SectionSlidePar
_showAnimation->setDirection(direction);
_showAnimation->setRepaintCallback([this] { update(); });
_showAnimation->setFinishedCallback([this] { showFinished(); });
_showAnimation->setPixmaps(params.oldContentCache, myContentCache);
_showAnimation->setPixmaps(
params.oldContentCache,
myContentCache);
_showAnimation->setTopBarShadow(params.withTopBarShadow);
_showAnimation->start();
@@ -82,4 +92,8 @@ void SectionWidget::showFinished() {
setInnerFocus();
}
rpl::producer<int> SectionWidget::desiredHeight() const {
return rpl::single(height());
}
} // namespace Window