2016-11-11 19:51:59 +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-11-11 19:51:59 +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-11-11 19:51:59 +00:00
|
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
|
2017-06-29 19:09:10 +00:00
|
|
|
#include "base/timer.h"
|
|
|
|
|
2016-11-11 19:51:59 +00:00
|
|
|
namespace Ui {
|
2017-04-05 09:21:38 +00:00
|
|
|
class IconButton;
|
2016-11-16 10:44:06 +00:00
|
|
|
class FlatLabel;
|
2016-11-11 19:51:59 +00:00
|
|
|
class Menu;
|
2016-11-16 10:44:06 +00:00
|
|
|
class UserpicButton;
|
2017-11-13 15:50:10 +00:00
|
|
|
} // namespace Ui
|
2016-11-16 10:44:06 +00:00
|
|
|
|
2016-11-11 19:51:59 +00:00
|
|
|
namespace Window {
|
|
|
|
|
2017-11-13 15:50:10 +00:00
|
|
|
class Controller;
|
|
|
|
|
2016-11-16 10:44:06 +00:00
|
|
|
class MainMenu : public TWidget, private base::Subscriber {
|
2016-11-11 19:51:59 +00:00
|
|
|
public:
|
2017-11-13 15:50:10 +00:00
|
|
|
MainMenu(QWidget *parent, not_null<Controller*> controller);
|
2016-11-11 19:51:59 +00:00
|
|
|
|
2016-11-17 11:03:49 +00:00
|
|
|
void setInnerFocus() {
|
|
|
|
setFocus();
|
|
|
|
}
|
2016-11-16 10:44:06 +00:00
|
|
|
|
2016-11-11 19:51:59 +00:00
|
|
|
protected:
|
|
|
|
void paintEvent(QPaintEvent *e) override;
|
|
|
|
void resizeEvent(QResizeEvent *e) override;
|
|
|
|
|
|
|
|
private:
|
2016-11-16 10:44:06 +00:00
|
|
|
void updateControlsGeometry();
|
2017-05-07 09:00:49 +00:00
|
|
|
void updatePhone();
|
2017-04-28 17:16:14 +00:00
|
|
|
void refreshMenu();
|
2016-11-16 10:44:06 +00:00
|
|
|
|
2017-11-13 15:50:10 +00:00
|
|
|
not_null<Controller*> _controller;
|
|
|
|
object_ptr<Ui::UserpicButton> _userpicButton = { nullptr };
|
2017-04-05 09:21:38 +00:00
|
|
|
object_ptr<Ui::IconButton> _cloudButton = { nullptr };
|
2016-12-13 17:07:56 +00:00
|
|
|
object_ptr<Ui::Menu> _menu;
|
|
|
|
object_ptr<Ui::FlatLabel> _telegram;
|
|
|
|
object_ptr<Ui::FlatLabel> _version;
|
2017-06-29 19:09:10 +00:00
|
|
|
std::shared_ptr<QPointer<QAction>> _nightThemeAction;
|
|
|
|
base::Timer _nightThemeSwitch;
|
2016-11-16 10:44:06 +00:00
|
|
|
|
2017-05-07 09:00:49 +00:00
|
|
|
QString _phoneText;
|
2016-11-11 19:51:59 +00:00
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace Window
|