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

69 lines
1.6 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
2024-04-11 13:12:57 +04:00
namespace Window {
class SessionController;
} // namespace Window
2024-04-09 19:04:18 +04:00
namespace Dialogs {
class Suggestions final : public Ui::RpWidget {
public:
Suggestions(
not_null<QWidget*> parent,
2024-04-11 13:12:57 +04:00
not_null<Window::SessionController*> controller,
2024-04-09 19:04:18 +04:00
rpl::producer<TopPeersList> topPeers);
~Suggestions();
2024-04-11 13:55:38 +04:00
void selectSkip(int delta);
void selectSkipPage(int height, int direction);
void selectLeft();
void selectRight();
void chooseRow();
2024-04-09 19:04:18 +04:00
[[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();
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