2016-12-08 14:08:54 +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-12-08 14:08:54 +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-12-08 14:08:54 +00:00
|
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "ui/abstract_button.h"
|
|
|
|
|
2020-06-18 11:17:58 +00:00
|
|
|
namespace Main {
|
|
|
|
class Session;
|
|
|
|
} // namespace Main
|
|
|
|
|
2016-12-08 14:08:54 +00:00
|
|
|
namespace Profile {
|
|
|
|
|
2021-07-15 11:12:38 +00:00
|
|
|
class BackButton final : public Ui::AbstractButton {
|
2016-12-08 14:08:54 +00:00
|
|
|
public:
|
2020-06-18 11:17:58 +00:00
|
|
|
BackButton(
|
|
|
|
QWidget *parent,
|
|
|
|
not_null<Main::Session*> session,
|
2021-05-26 21:39:30 +00:00
|
|
|
const QString &text,
|
|
|
|
rpl::producer<bool> oneColumnValue);
|
2016-12-08 14:08:54 +00:00
|
|
|
|
2017-06-18 11:08:14 +00:00
|
|
|
void setText(const QString &text);
|
|
|
|
|
2016-12-08 14:08:54 +00:00
|
|
|
protected:
|
|
|
|
void paintEvent(QPaintEvent *e) override;
|
|
|
|
|
|
|
|
int resizeGetHeight(int newWidth) override;
|
|
|
|
void onStateChanged(State was, StateChangeSource source) override;
|
|
|
|
|
|
|
|
private:
|
2020-06-18 11:17:58 +00:00
|
|
|
const not_null<Main::Session*> _session;
|
|
|
|
|
|
|
|
rpl::lifetime _unreadBadgeLifetime;
|
2016-12-08 14:08:54 +00:00
|
|
|
QString _text;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace Profile
|