2016-11-02 14:44:33 +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-02 14:44:33 +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-02 14:44:33 +00:00
|
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
|
2016-11-11 13:46:04 +00:00
|
|
|
namespace Ui {
|
2017-02-03 20:07:26 +00:00
|
|
|
class FlatButton;
|
|
|
|
class ScrollArea;
|
|
|
|
class CrossButton;
|
|
|
|
class MultiSelect;
|
2017-09-30 18:26:45 +00:00
|
|
|
class PlainShadow;
|
2016-11-11 13:46:04 +00:00
|
|
|
} // namespace Ui
|
2016-11-02 14:44:33 +00:00
|
|
|
|
|
|
|
namespace Window {
|
2019-09-03 08:25:19 +00:00
|
|
|
|
|
|
|
class Controller;
|
|
|
|
|
2016-11-02 14:44:33 +00:00
|
|
|
namespace Theme {
|
|
|
|
|
2019-08-26 16:36:23 +00:00
|
|
|
bool CopyColorsToPalette(
|
|
|
|
const QString &destination,
|
|
|
|
const QString &themePath,
|
|
|
|
const QByteArray &themeContent);
|
|
|
|
|
2017-02-03 20:07:26 +00:00
|
|
|
class Editor : public TWidget {
|
|
|
|
public:
|
2019-09-03 08:25:19 +00:00
|
|
|
Editor(QWidget*, not_null<Window::Controller*> window);
|
2016-11-02 14:44:33 +00:00
|
|
|
|
|
|
|
protected:
|
|
|
|
void paintEvent(QPaintEvent *e) override;
|
|
|
|
void resizeEvent(QResizeEvent *e) override;
|
2017-02-03 20:07:26 +00:00
|
|
|
void keyPressEvent(QKeyEvent *e) override;
|
2016-11-02 14:44:33 +00:00
|
|
|
|
2017-02-03 20:07:26 +00:00
|
|
|
void focusInEvent(QFocusEvent *e) override;
|
2016-11-02 14:44:33 +00:00
|
|
|
|
2017-02-03 20:07:26 +00:00
|
|
|
private:
|
2019-09-03 08:25:19 +00:00
|
|
|
void save();
|
2017-02-03 20:07:26 +00:00
|
|
|
void closeEditor();
|
|
|
|
|
2019-09-03 08:25:19 +00:00
|
|
|
not_null<Window::Controller*> _window;
|
2017-02-03 20:07:26 +00:00
|
|
|
object_ptr<Ui::ScrollArea> _scroll;
|
|
|
|
class Inner;
|
|
|
|
QPointer<Inner> _inner;
|
|
|
|
object_ptr<Ui::CrossButton> _close;
|
|
|
|
object_ptr<Ui::MultiSelect> _select;
|
2017-09-30 18:26:45 +00:00
|
|
|
object_ptr<Ui::PlainShadow> _leftShadow;
|
|
|
|
object_ptr<Ui::PlainShadow> _topShadow;
|
2019-09-03 08:25:19 +00:00
|
|
|
object_ptr<Ui::FlatButton> _save;
|
2016-11-02 14:44:33 +00:00
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace Theme
|
|
|
|
} // namespace Window
|