2016-05-27 10:57:11 +00:00
|
|
|
/*
|
|
|
|
This file is part of Telegram Desktop,
|
2018-01-03 10:23:14 +00:00
|
|
|
the official desktop application for the Telegram messaging service.
|
2016-05-27 10:57:11 +00:00
|
|
|
|
2018-01-03 10:23:14 +00:00
|
|
|
For license and copyright information please follow this link:
|
|
|
|
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
2016-05-27 10:57:11 +00:00
|
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
namespace Profile {
|
|
|
|
|
|
|
|
class CoverDropArea : public TWidget {
|
|
|
|
public:
|
|
|
|
CoverDropArea(QWidget *parent, const QString &title, const QString &subtitle);
|
|
|
|
|
|
|
|
void showAnimated();
|
|
|
|
|
2016-11-20 12:54:07 +00:00
|
|
|
using HideFinishCallback = base::lambda<void(CoverDropArea*)>;
|
2016-05-27 10:57:11 +00:00
|
|
|
void hideAnimated(HideFinishCallback &&callback);
|
|
|
|
|
|
|
|
bool hiding() const {
|
|
|
|
return _hiding;
|
|
|
|
}
|
|
|
|
|
|
|
|
protected:
|
|
|
|
void paintEvent(QPaintEvent *e) override;
|
|
|
|
|
|
|
|
private:
|
|
|
|
void setupAnimation();
|
|
|
|
|
|
|
|
QString _title, _subtitle;
|
|
|
|
int _titleWidth, _subtitleWidth;
|
|
|
|
|
|
|
|
QPixmap _cache;
|
2016-12-07 13:32:25 +00:00
|
|
|
Animation _a_appearance;
|
2016-05-27 10:57:11 +00:00
|
|
|
bool _hiding = false;
|
|
|
|
HideFinishCallback _hideFinishCallback;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace Profile
|