2017-09-13 17:01:23 +00:00
|
|
|
/*
|
|
|
|
This file is part of Telegram Desktop,
|
|
|
|
the official desktop version of Telegram messaging app, see https://telegram.org
|
|
|
|
|
|
|
|
Telegram Desktop is free software: you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation, either version 3 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
It is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
In addition, as a special exception, the copyright holders give permission
|
|
|
|
to link the code of portions of this program with the OpenSSL library.
|
|
|
|
|
|
|
|
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
|
|
|
|
Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
|
|
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "layerwidget.h"
|
|
|
|
|
|
|
|
namespace Window {
|
|
|
|
class Controller;
|
|
|
|
} // namespace Window
|
|
|
|
|
|
|
|
namespace Info {
|
|
|
|
|
|
|
|
class Memento;
|
2017-09-15 17:34:41 +00:00
|
|
|
class MoveMemento;
|
2017-09-13 17:01:23 +00:00
|
|
|
class ContentWidget;
|
|
|
|
class TopBar;
|
|
|
|
|
|
|
|
class LayerWrap : public LayerWidget {
|
|
|
|
public:
|
|
|
|
LayerWrap(
|
|
|
|
not_null<Window::Controller*> controller,
|
|
|
|
not_null<Memento*> memento);
|
2017-09-15 17:34:41 +00:00
|
|
|
LayerWrap(
|
|
|
|
not_null<Window::Controller*> controller,
|
|
|
|
not_null<MoveMemento*> memento);
|
2017-09-13 17:01:23 +00:00
|
|
|
|
|
|
|
void showFinished() override;
|
|
|
|
void parentResized() override;
|
|
|
|
|
2017-09-19 10:32:34 +00:00
|
|
|
bool takeToThirdSection() override;
|
|
|
|
|
2017-09-15 17:34:41 +00:00
|
|
|
static int MinimalSupportedWidth();
|
|
|
|
|
2017-09-13 17:01:23 +00:00
|
|
|
protected:
|
2017-09-15 17:34:41 +00:00
|
|
|
int resizeGetHeight(int newWidth) override;
|
2017-09-13 17:01:23 +00:00
|
|
|
|
2017-09-15 17:34:41 +00:00
|
|
|
void paintEvent(QPaintEvent *e) override;
|
2017-09-13 17:01:23 +00:00
|
|
|
|
|
|
|
private:
|
2017-09-15 17:34:41 +00:00
|
|
|
void setupHeightConsumers();
|
|
|
|
|
2017-09-13 17:01:23 +00:00
|
|
|
object_ptr<ContentWidget> createContent(
|
|
|
|
not_null<Window::Controller*> controller,
|
|
|
|
not_null<Memento*> memento);
|
2017-09-15 17:34:41 +00:00
|
|
|
object_ptr<TopBar> createTopBar();
|
2017-09-13 17:01:23 +00:00
|
|
|
|
2017-09-15 17:34:41 +00:00
|
|
|
void setRoundedCorners(bool roundedCorners);
|
2017-09-13 17:01:23 +00:00
|
|
|
|
2017-09-15 17:34:41 +00:00
|
|
|
not_null<Window::Controller*> _controller;
|
2017-09-13 17:01:23 +00:00
|
|
|
object_ptr<ContentWidget> _content;
|
2017-09-15 17:34:41 +00:00
|
|
|
object_ptr<TopBar> _topBar;
|
2017-09-13 17:01:23 +00:00
|
|
|
|
|
|
|
int _desiredHeight = 0;
|
|
|
|
bool _roundedCorners = false;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace Info
|