2016-05-12 16:05:20 +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-2016 John Preston, https://desktop.telegram.org
|
|
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
|
2016-05-19 12:03:51 +00:00
|
|
|
#include "window/section_widget.h"
|
2016-10-12 19:34:25 +00:00
|
|
|
#include "ui/widgets/shadow.h"
|
2016-05-12 16:05:20 +00:00
|
|
|
|
2016-11-16 10:44:06 +00:00
|
|
|
namespace Ui {
|
2016-05-12 16:05:20 +00:00
|
|
|
class ScrollArea;
|
2016-11-16 10:44:06 +00:00
|
|
|
} // namespace Ui
|
2016-05-12 16:05:20 +00:00
|
|
|
|
|
|
|
namespace Profile {
|
|
|
|
|
2016-05-19 12:03:51 +00:00
|
|
|
class SectionMemento;
|
2016-05-12 16:05:20 +00:00
|
|
|
class InnerWidget;
|
2016-05-14 16:57:06 +00:00
|
|
|
class FixedBar;
|
2016-05-19 12:03:51 +00:00
|
|
|
class Widget final : public Window::SectionWidget {
|
2016-05-12 16:05:20 +00:00
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
Widget(QWidget *parent, PeerData *peer);
|
|
|
|
|
|
|
|
PeerData *peer() const;
|
2016-05-19 12:03:51 +00:00
|
|
|
PeerData *peerForDialogs() const override {
|
|
|
|
return peer();
|
|
|
|
}
|
|
|
|
|
|
|
|
bool hasTopBarShadow() const override {
|
|
|
|
return _fixedBarShadow->isFullyShown();
|
|
|
|
}
|
2016-05-12 16:05:20 +00:00
|
|
|
|
2016-05-19 12:03:51 +00:00
|
|
|
QPixmap grabForShowAnimation(const Window::SectionSlideParams ¶ms) override;
|
2016-05-12 16:05:20 +00:00
|
|
|
|
2016-05-19 12:03:51 +00:00
|
|
|
void setInnerFocus() override;
|
2016-05-12 16:05:20 +00:00
|
|
|
|
2016-06-06 11:35:49 +00:00
|
|
|
bool showInternal(const Window::SectionMemento *memento) override;
|
2016-05-19 12:03:51 +00:00
|
|
|
std_::unique_ptr<Window::SectionMemento> createMemento() const override;
|
|
|
|
|
|
|
|
void setInternalState(const SectionMemento *memento);
|
2016-05-12 16:05:20 +00:00
|
|
|
|
|
|
|
protected:
|
|
|
|
void resizeEvent(QResizeEvent *e) override;
|
2016-05-19 12:03:51 +00:00
|
|
|
|
|
|
|
void showAnimatedHook() override;
|
|
|
|
void showFinishedHook() override;
|
2016-05-12 16:05:20 +00:00
|
|
|
|
2016-05-14 16:57:06 +00:00
|
|
|
private slots:
|
|
|
|
void onScroll();
|
|
|
|
|
2016-05-12 16:05:20 +00:00
|
|
|
private:
|
2016-08-27 04:49:18 +00:00
|
|
|
void updateAdaptiveLayout();
|
|
|
|
|
2016-05-19 12:03:51 +00:00
|
|
|
friend class SectionMemento;
|
2016-05-12 16:05:20 +00:00
|
|
|
|
2016-11-16 10:44:06 +00:00
|
|
|
ChildWidget<Ui::ScrollArea> _scroll;
|
2016-05-12 16:05:20 +00:00
|
|
|
ChildWidget<InnerWidget> _inner;
|
2016-05-19 12:03:51 +00:00
|
|
|
ChildWidget<FixedBar> _fixedBar;
|
2016-10-12 19:34:25 +00:00
|
|
|
ChildWidget<Ui::ToggleableShadow> _fixedBarShadow;
|
2016-05-12 16:05:20 +00:00
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace Profile
|