Provided peer to profile top bar.

This commit is contained in:
23rd
2025-10-08 12:24:25 +03:00
parent 0de7b4eb39
commit b4d49715dc
3 changed files with 13 additions and 4 deletions
@@ -336,7 +336,7 @@ bool InnerWidget::hasFlexibleTopBar() const {
base::weak_qptr<Ui::RpWidget> InnerWidget::createPinnedToTop(
not_null<Ui::RpWidget*> parent) {
const auto content = Ui::CreateChild<TopBar>(parent);
const auto content = Ui::CreateChild<TopBar>(parent, _peer);
struct State {
base::unique_qptr<Ui::IconButton> close;
base::unique_qptr<Ui::FadeWrap<Ui::IconButton>> back;
@@ -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<Ui::RpWidget*> parent,
not_null<PeerData*> peer)
: RpWidget(parent)
, _peer(peer) {
setMinimumHeight(st::infoLayerTopBarHeight);
setMaximumHeight(st::settingsPremiumTopHeight);
}
@@ -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<Ui::RpWidget*> parent, not_null<PeerData*> 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<PeerData*> _peer;
bool _roundEdges = true;
};