2015-02-03 18:02:46 +03:00
|
|
|
/*
|
|
|
|
This file is part of Telegram Desktop,
|
2018-01-03 13:23:14 +03:00
|
|
|
the official desktop application for the Telegram messaging service.
|
2015-02-03 18:02:46 +03:00
|
|
|
|
2018-01-03 13:23:14 +03:00
|
|
|
For license and copyright information please follow this link:
|
|
|
|
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
2015-02-03 18:02:46 +03:00
|
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
|
2023-11-15 03:52:41 +03:00
|
|
|
#include "ui/layers/box_content.h"
|
2016-11-21 19:24:23 +03:00
|
|
|
|
2023-04-18 16:47:31 +04:00
|
|
|
class PeerData;
|
|
|
|
|
2020-06-10 22:08:17 +04:00
|
|
|
namespace Window {
|
|
|
|
class SessionController;
|
|
|
|
} // namespace Window
|
2019-07-24 16:00:30 +02:00
|
|
|
|
2019-02-09 16:36:07 +03:00
|
|
|
namespace Data {
|
|
|
|
class WallPaper;
|
|
|
|
} // namespace Data
|
|
|
|
|
2019-09-18 14:19:05 +03:00
|
|
|
class BackgroundBox : public Ui::BoxContent {
|
2015-02-03 18:02:46 +03:00
|
|
|
public:
|
2023-04-18 16:47:31 +04:00
|
|
|
BackgroundBox(
|
|
|
|
QWidget*,
|
|
|
|
not_null<Window::SessionController*> controller,
|
|
|
|
PeerData *forPeer = nullptr);
|
2015-02-03 18:02:46 +03:00
|
|
|
|
2016-12-13 20:07:56 +03:00
|
|
|
protected:
|
|
|
|
void prepare() override;
|
2015-02-03 18:02:46 +03:00
|
|
|
|
2016-08-16 19:53:10 +03:00
|
|
|
private:
|
2016-10-20 19:32:15 +03:00
|
|
|
class Inner;
|
2019-02-09 16:36:07 +03:00
|
|
|
|
2023-04-18 16:47:31 +04:00
|
|
|
void chosen(const Data::WallPaper &paper);
|
|
|
|
[[nodiscard]] bool hasDefaultForPeer() const;
|
|
|
|
[[nodiscard]] bool chosenDefaultForPeer(
|
|
|
|
const Data::WallPaper &paper) const;
|
2019-02-09 16:36:07 +03:00
|
|
|
void removePaper(const Data::WallPaper &paper);
|
2023-04-18 16:47:31 +04:00
|
|
|
void resetForPeer();
|
2023-12-22 00:17:44 -04:00
|
|
|
[[nodiscard]] bool forChannel() const;
|
2019-02-09 16:36:07 +03:00
|
|
|
|
2023-04-19 10:42:01 +04:00
|
|
|
void chooseFromFile();
|
|
|
|
|
2020-06-10 22:08:17 +04:00
|
|
|
const not_null<Window::SessionController*> _controller;
|
2019-07-24 16:00:30 +02:00
|
|
|
|
2016-12-13 20:07:56 +03:00
|
|
|
QPointer<Inner> _inner;
|
2023-04-18 16:47:31 +04:00
|
|
|
PeerData *_forPeer = nullptr;
|
2015-02-03 18:02:46 +03:00
|
|
|
|
|
|
|
};
|