tdesktop/Telegram/SourceFiles/window/window_main_menu.h

55 lines
1.2 KiB
C
Raw Normal View History

2016-11-11 19:51:59 +00:00
/*
This file is part of Telegram Desktop,
the official desktop application for the Telegram messaging service.
2016-11-11 19:51:59 +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
#include "base/timer.h"
2016-11-11 19:51:59 +00:00
namespace Ui {
class IconButton;
class FlatLabel;
2016-11-11 19:51:59 +00:00
class Menu;
class UserpicButton;
} // namespace Ui
2016-11-11 19:51:59 +00:00
namespace Window {
class Controller;
class MainMenu : public TWidget, private base::Subscriber {
2016-11-11 19:51:59 +00:00
public:
MainMenu(QWidget *parent, not_null<Controller*> controller);
2016-11-11 19:51:59 +00:00
void setInnerFocus() {
setFocus();
}
2016-11-11 19:51:59 +00:00
protected:
void paintEvent(QPaintEvent *e) override;
void resizeEvent(QResizeEvent *e) override;
private:
void checkSelf();
void updateControlsGeometry();
void updatePhone();
void refreshMenu();
not_null<Controller*> _controller;
object_ptr<Ui::UserpicButton> _userpicButton = { nullptr };
object_ptr<Ui::IconButton> _cloudButton = { nullptr };
object_ptr<Ui::Menu> _menu;
object_ptr<Ui::FlatLabel> _telegram;
object_ptr<Ui::FlatLabel> _version;
std::shared_ptr<QPointer<QAction>> _nightThemeAction;
base::Timer _nightThemeSwitch;
QString _phoneText;
2016-11-11 19:51:59 +00:00
};
} // namespace Window