diff --git a/Telegram/SourceFiles/info/profile/info_profile_inner_widget.cpp b/Telegram/SourceFiles/info/profile/info_profile_inner_widget.cpp index a4c1ba1c94..3cd6ea79d5 100644 --- a/Telegram/SourceFiles/info/profile/info_profile_inner_widget.cpp +++ b/Telegram/SourceFiles/info/profile/info_profile_inner_widget.cpp @@ -336,7 +336,7 @@ bool InnerWidget::hasFlexibleTopBar() const { base::weak_qptr InnerWidget::createPinnedToTop( not_null parent) { - const auto content = Ui::CreateChild(parent); + const auto content = Ui::CreateChild(parent, _peer); struct State { base::unique_qptr close; base::unique_qptr> back; diff --git a/Telegram/SourceFiles/info/profile/info_profile_top_bar.cpp b/Telegram/SourceFiles/info/profile/info_profile_top_bar.cpp index 46609f7c1a..37f6a49df3 100644 --- a/Telegram/SourceFiles/info/profile/info_profile_top_bar.cpp +++ b/Telegram/SourceFiles/info/profile/info_profile_top_bar.cpp @@ -7,6 +7,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL */ #include "info/profile/info_profile_top_bar.h" +#include "data/data_peer.h" +#include "info_profile_actions.h" #include "ui/painter.h" #include "styles/style_boxes.h" #include "styles/style_info.h" @@ -15,8 +17,11 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL namespace Info::Profile { -TopBar::TopBar(QWidget *parent) -: RpWidget(parent) { +TopBar::TopBar( + not_null parent, + not_null peer) +: RpWidget(parent) +, _peer(peer) { setMinimumHeight(st::infoLayerTopBarHeight); setMaximumHeight(st::settingsPremiumTopHeight); } diff --git a/Telegram/SourceFiles/info/profile/info_profile_top_bar.h b/Telegram/SourceFiles/info/profile/info_profile_top_bar.h index cd703d669e..6d284d5482 100644 --- a/Telegram/SourceFiles/info/profile/info_profile_top_bar.h +++ b/Telegram/SourceFiles/info/profile/info_profile_top_bar.h @@ -9,11 +9,13 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "ui/rp_widget.h" +class PeerData; + namespace Info::Profile { class TopBar final : public Ui::RpWidget { public: - TopBar(QWidget *parent); + TopBar(not_null parent, not_null peer); void setRoundEdges(bool value); @@ -24,6 +26,8 @@ private: void paintEdges(QPainter &p, const QBrush &brush) const; void paintEdges(QPainter &p) const; + const not_null _peer; + bool _roundEdges = true; };