2016-05-12 19:05:20 +03: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 22:31:31 +04:00
|
|
|
Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
|
2016-05-12 19:05:20 +03:00
|
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
|
2016-05-19 15:03:51 +03:00
|
|
|
#include "window/section_widget.h"
|
2016-05-12 19:05:20 +03:00
|
|
|
|
2016-11-16 13:44:06 +03:00
|
|
|
namespace Ui {
|
2016-05-12 19:05:20 +03:00
|
|
|
class ScrollArea;
|
2017-09-30 21:26:45 +03:00
|
|
|
class FadeShadow;
|
2016-11-16 13:44:06 +03:00
|
|
|
} // namespace Ui
|
2016-05-12 19:05:20 +03:00
|
|
|
|
|
|
|
namespace Profile {
|
|
|
|
|
2016-05-19 15:03:51 +03:00
|
|
|
class SectionMemento;
|
2016-05-12 19:05:20 +03:00
|
|
|
class InnerWidget;
|
2016-05-14 19:57:06 +03:00
|
|
|
class FixedBar;
|
2016-05-19 15:03:51 +03:00
|
|
|
class Widget final : public Window::SectionWidget {
|
2016-05-12 19:05:20 +03:00
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2017-08-17 11:31:24 +03:00
|
|
|
Widget(QWidget *parent, not_null<Window::Controller*> controller, PeerData *peer);
|
2016-05-12 19:05:20 +03:00
|
|
|
|
|
|
|
PeerData *peer() const;
|
2017-11-08 20:45:30 +04:00
|
|
|
PeerData *activePeer() const override {
|
2016-05-19 15:03:51 +03:00
|
|
|
return peer();
|
|
|
|
}
|
|
|
|
|
2016-12-08 17:08:54 +03:00
|
|
|
bool hasTopBarShadow() const override;
|
2016-05-12 19:05:20 +03:00
|
|
|
|
2016-05-19 15:03:51 +03:00
|
|
|
QPixmap grabForShowAnimation(const Window::SectionSlideParams ¶ms) override;
|
2016-05-12 19:05:20 +03:00
|
|
|
|
2017-10-03 14:05:58 +01:00
|
|
|
bool showInternal(
|
|
|
|
not_null<Window::SectionMemento*> memento,
|
|
|
|
const Window::SectionShow ¶ms) override;
|
2017-06-24 20:05:32 +03:00
|
|
|
std::unique_ptr<Window::SectionMemento> createMemento() override;
|
2016-05-19 15:03:51 +03:00
|
|
|
|
2017-08-17 11:31:24 +03:00
|
|
|
void setInternalState(const QRect &geometry, not_null<SectionMemento*> memento);
|
2016-05-12 19:05:20 +03:00
|
|
|
|
2017-05-22 18:25:49 +03:00
|
|
|
// Float player interface.
|
2017-09-16 19:53:41 +03:00
|
|
|
bool wheelEventFromFloatPlayer(QEvent *e) override;
|
|
|
|
QRect rectForFloatPlayer() const override;
|
2017-05-22 18:25:49 +03:00
|
|
|
|
2016-05-12 19:05:20 +03:00
|
|
|
protected:
|
|
|
|
void resizeEvent(QResizeEvent *e) override;
|
2016-05-19 15:03:51 +03:00
|
|
|
|
2017-10-03 18:41:44 +01:00
|
|
|
void showAnimatedHook(
|
|
|
|
const Window::SectionSlideParams ¶ms) override;
|
2016-05-19 15:03:51 +03:00
|
|
|
void showFinishedHook() override;
|
2017-01-14 21:50:16 +03:00
|
|
|
void doSetInnerFocus() override;
|
2016-05-12 19:05:20 +03:00
|
|
|
|
2016-05-14 19:57:06 +03:00
|
|
|
private slots:
|
|
|
|
void onScroll();
|
|
|
|
|
2016-05-12 19:05:20 +03:00
|
|
|
private:
|
2016-12-13 20:07:56 +03:00
|
|
|
void updateScrollState();
|
2016-08-26 22:49:18 -06:00
|
|
|
void updateAdaptiveLayout();
|
2017-08-17 11:31:24 +03:00
|
|
|
void saveState(not_null<SectionMemento*> memento);
|
|
|
|
void restoreState(not_null<SectionMemento*> memento);
|
2016-05-12 19:05:20 +03:00
|
|
|
|
2016-12-13 20:07:56 +03:00
|
|
|
object_ptr<Ui::ScrollArea> _scroll;
|
|
|
|
QPointer<InnerWidget> _inner;
|
|
|
|
object_ptr<FixedBar> _fixedBar;
|
2017-09-30 21:26:45 +03:00
|
|
|
object_ptr<Ui::FadeShadow> _fixedBarShadow;
|
2016-05-12 19:05:20 +03:00
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace Profile
|