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
|
2017-01-11 18:31:31 +00:00
|
|
|
Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
|
2016-05-12 16:05:20 +00:00
|
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
|
2016-05-19 12:03:51 +00:00
|
|
|
#include "window/section_widget.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-12-13 17:07:56 +00:00
|
|
|
class PlainShadow;
|
|
|
|
template <typename Widget>
|
|
|
|
class WidgetFadeWrap;
|
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:
|
2017-08-17 08:31:24 +00:00
|
|
|
Widget(QWidget *parent, not_null<Window::Controller*> controller, PeerData *peer);
|
2016-05-12 16:05:20 +00:00
|
|
|
|
|
|
|
PeerData *peer() const;
|
2016-05-19 12:03:51 +00:00
|
|
|
PeerData *peerForDialogs() const override {
|
|
|
|
return peer();
|
|
|
|
}
|
|
|
|
|
2016-12-08 14:08:54 +00:00
|
|
|
bool hasTopBarShadow() const override;
|
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
|
|
|
|
2017-08-17 08:31:24 +00:00
|
|
|
bool showInternal(not_null<Window::SectionMemento*> memento) override;
|
2017-06-24 17:05:32 +00:00
|
|
|
std::unique_ptr<Window::SectionMemento> createMemento() override;
|
2016-05-19 12:03:51 +00:00
|
|
|
|
2017-08-17 08:31:24 +00:00
|
|
|
void setInternalState(const QRect &geometry, not_null<SectionMemento*> memento);
|
2016-05-12 16:05:20 +00:00
|
|
|
|
2017-05-22 15:25:49 +00:00
|
|
|
// Float player interface.
|
|
|
|
bool wheelEventFromFloatPlayer(QEvent *e, Window::Column myColumn, Window::Column playerColumn) override;
|
2017-09-13 16:57:44 +00:00
|
|
|
QRect rectForFloatPlayer(Window::Column myColumn, Window::Column playerColumn) const override;
|
2017-05-22 15:25:49 +00:00
|
|
|
|
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;
|
2017-01-14 18:50:16 +00:00
|
|
|
void doSetInnerFocus() 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-12-13 17:07:56 +00:00
|
|
|
void updateScrollState();
|
2016-08-27 04:49:18 +00:00
|
|
|
void updateAdaptiveLayout();
|
2017-08-17 08:31:24 +00:00
|
|
|
void saveState(not_null<SectionMemento*> memento);
|
|
|
|
void restoreState(not_null<SectionMemento*> memento);
|
2016-05-12 16:05:20 +00:00
|
|
|
|
2016-12-13 17:07:56 +00:00
|
|
|
object_ptr<Ui::ScrollArea> _scroll;
|
|
|
|
QPointer<InnerWidget> _inner;
|
|
|
|
object_ptr<FixedBar> _fixedBar;
|
|
|
|
object_ptr<Ui::WidgetFadeWrap<Ui::PlainShadow>> _fixedBarShadow;
|
2016-05-12 16:05:20 +00:00
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace Profile
|