2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-23 10:47:11 +00:00
tdesktop/Telegram/SourceFiles/dialogs/ui/dialogs_suggestions.h

60 lines
1.4 KiB
C
Raw Normal View History

2024-04-09 19:04:18 +04:00
/*
This file is part of Telegram Desktop,
the official desktop application for the Telegram messaging service.
For license and copyright information please follow this link:
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
#pragma once
#include "base/object_ptr.h"
#include "dialogs/ui/top_peers_strip.h"
#include "ui/rp_widget.h"
namespace Main {
class Session;
} // namespace Main
namespace Ui {
class ElasticScroll;
class VerticalLayout;
template <typename Widget>
class SlideWrap;
} // namespace Ui
namespace Dialogs {
class Suggestions final : public Ui::RpWidget {
public:
Suggestions(
not_null<QWidget*> parent,
rpl::producer<TopPeersList> topPeers);
~Suggestions();
[[nodiscard]] rpl::producer<PeerId> topPeerChosen() const {
return _topPeerChosen.events();
}
private:
void paintEvent(QPaintEvent *e) override;
void resizeEvent(QResizeEvent *e) override;
[[nodiscard]] object_ptr<Ui::RpWidget> setupDivider();
void updateControlsGeometry();
const std::unique_ptr<Ui::ElasticScroll> _scroll;
const not_null<Ui::VerticalLayout*> _content;
const not_null<Ui::SlideWrap<TopPeersStrip>*> _topPeersWrap;
const not_null<TopPeersStrip*> _topPeers;
const not_null<Ui::RpWidget*> _divider;
rpl::event_stream<PeerId> _topPeerChosen;
};
2024-04-11 12:41:32 +04:00
[[nodiscard]] rpl::producer<TopPeersList> TopPeersContent(
2024-04-09 19:04:18 +04:00
not_null<Main::Session*> session);
} // namespace Dialogs