mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-18 07:07:08 +02:00
Play emoji status only twice in main menu.
This commit is contained in:
parent
742b819c7e
commit
5530df8f2d
5 changed files with 15 additions and 0 deletions
Telegram/SourceFiles
info/profile
settings
window
|
@ -87,10 +87,12 @@ BadgeView::BadgeView(
|
|||
const style::InfoPeerBadge &st,
|
||||
not_null<PeerData*> peer,
|
||||
Fn<bool()> animationPaused,
|
||||
int customStatusLoopsLimit,
|
||||
base::flags<Badge> allowed)
|
||||
: _parent(parent)
|
||||
, _st(st)
|
||||
, _peer(peer)
|
||||
, _customStatusLoopsLimit(customStatusLoopsLimit)
|
||||
, _allowed(allowed)
|
||||
, _animationPaused(std::move(animationPaused)) {
|
||||
rpl::combine(
|
||||
|
@ -144,6 +146,11 @@ void BadgeView::setBadge(Badge badge, DocumentId emojiStatusId) {
|
|||
_emojiStatusId,
|
||||
[raw = _view.data()] { raw->update(); },
|
||||
tag);
|
||||
if (_customStatusLoopsLimit > 0) {
|
||||
_emojiStatus = std::make_unique<Ui::Text::LimitedLoopsEmoji>(
|
||||
std::move(_emojiStatus),
|
||||
_customStatusLoopsLimit);
|
||||
}
|
||||
_emojiStatusColored = std::make_unique<
|
||||
Ui::Text::CustomEmojiColored
|
||||
>();
|
||||
|
|
|
@ -61,6 +61,7 @@ public:
|
|||
const style::InfoPeerBadge &st,
|
||||
not_null<PeerData*> peer,
|
||||
Fn<bool()> animationPaused,
|
||||
int customStatusLoopsLimit = 0,
|
||||
base::flags<Badge> allowed = base::flags<Badge>::from_raw(-1));
|
||||
|
||||
[[nodiscard]] Ui::RpWidget *widget() const;
|
||||
|
@ -75,6 +76,7 @@ private:
|
|||
const not_null<QWidget*> _parent;
|
||||
const style::InfoPeerBadge &_st;
|
||||
const not_null<PeerData*> _peer;
|
||||
const int _customStatusLoopsLimit = 0;
|
||||
DocumentId _emojiStatusId = 0;
|
||||
std::unique_ptr<Ui::Text::CustomEmoji> _emojiStatus;
|
||||
std::unique_ptr<Ui::Text::CustomEmojiColored> _emojiStatusColored;
|
||||
|
|
|
@ -64,6 +64,7 @@ namespace Settings {
|
|||
namespace {
|
||||
|
||||
constexpr auto kSaveBioTimeout = 1000;
|
||||
constexpr auto kPlayStatusLimit = 2;
|
||||
|
||||
class ComposedBadge final : public Ui::RpWidget {
|
||||
public:
|
||||
|
@ -99,6 +100,7 @@ ComposedBadge::ComposedBadge(
|
|||
st::settingsInfoPeerBadge,
|
||||
session->user(),
|
||||
std::move(animationPaused),
|
||||
kPlayStatusLimit,
|
||||
Info::Profile::Badge::Premium) {
|
||||
if (hasUnread) {
|
||||
_unread = CreateUnread(this, rpl::single(
|
||||
|
|
|
@ -114,6 +114,7 @@ Cover::Cover(
|
|||
return controller->isGifPausedAtLeastFor(
|
||||
Window::GifPauseReason::Layer);
|
||||
},
|
||||
0, // customStatusLoopsLimit
|
||||
Info::Profile::Badge::Premium)
|
||||
, _userpic(
|
||||
this,
|
||||
|
|
|
@ -73,6 +73,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
namespace Window {
|
||||
namespace {
|
||||
|
||||
constexpr auto kPlayStatusLimit = 2;
|
||||
|
||||
void ShowCallsBox(not_null<Window::SessionController*> window) {
|
||||
auto controller = std::make_unique<Calls::BoxController>(window);
|
||||
const auto initBox = [
|
||||
|
@ -341,6 +343,7 @@ MainMenu::MainMenu(
|
|||
st::settingsInfoPeerBadge,
|
||||
controller->session().user(),
|
||||
[=] { return controller->isGifPausedAtLeastFor(GifPauseReason::Layer); },
|
||||
kPlayStatusLimit,
|
||||
Info::Profile::Badge::Premium))
|
||||
, _emojiStatusPanel(std::make_unique<Info::Profile::EmojiStatusPanel>())
|
||||
, _scroll(this, st::defaultSolidScroll)
|
||||
|
|
Loading…
Add table
Reference in a new issue