2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 14:38:15 +00:00

Use separate TopBar for History and Overview.

Move TopBar widget to History and Overview from MainWidget.
This commit is contained in:
John Preston
2017-03-27 15:24:38 +03:00
parent cdca00368f
commit 8d4be19952
14 changed files with 309 additions and 315 deletions

View File

@@ -33,17 +33,24 @@ class Date;
} // namespace Overview
namespace Ui {
class AbstractButton;
class PlainShadow;
class PopupMenu;
class IconButton;
class FlatInput;
class CrossButton;
class DropdownMenu;
} // namespace Ui
namespace Notify {
struct PeerUpdate;
} // namespace Notify
namespace Window {
class Controller;
class TopBarWidget;
} // namespace Window
class OverviewWidget;
class OverviewInner : public TWidget, public Ui::AbstractTooltipShower, public RPCSender, private base::Subscriber {
Q_OBJECT
@@ -280,7 +287,7 @@ class OverviewWidget : public TWidget, public RPCSender {
Q_OBJECT
public:
OverviewWidget(QWidget *parent, PeerData *peer, MediaOverviewType type);
OverviewWidget(QWidget *parent, gsl::not_null<Window::Controller*> controller, PeerData *peer, MediaOverviewType type);
void clear();
@@ -288,13 +295,14 @@ public:
void scrollReset();
bool paintTopBar(Painter &p, int decreaseWidth);
void topBarClick();
PeerData *peer() const;
PeerData *migratePeer() const;
MediaOverviewType type() const;
void switchType(MediaOverviewType type);
bool showMediaTypeSwitch() const;
void updateTopBarSelection();
bool contentOverlapped(const QRect &globalRect);
int32 lastWidth() const;
int32 lastScrollTop() const;
@@ -361,12 +369,20 @@ public slots:
void onClearSelected();
private:
void topBarClick();
void animationCallback();
gsl::not_null<Window::Controller*> _controller;
object_ptr<Ui::AbstractButton> _backAnimationButton = { nullptr };
object_ptr<Window::TopBarWidget> _topBar;
object_ptr<Ui::ScrollArea> _scroll;
QPointer<OverviewInner> _inner;
bool _noDropResizeIndex = false;
object_ptr<Ui::DropdownMenu> _mediaType;
int32 _mediaTypeMask = 0;
QString _header;
Animation _a_show;