mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +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
|
@ -87,10 +87,12 @@ BadgeView::BadgeView(
|
||||||
const style::InfoPeerBadge &st,
|
const style::InfoPeerBadge &st,
|
||||||
not_null<PeerData*> peer,
|
not_null<PeerData*> peer,
|
||||||
Fn<bool()> animationPaused,
|
Fn<bool()> animationPaused,
|
||||||
|
int customStatusLoopsLimit,
|
||||||
base::flags<Badge> allowed)
|
base::flags<Badge> allowed)
|
||||||
: _parent(parent)
|
: _parent(parent)
|
||||||
, _st(st)
|
, _st(st)
|
||||||
, _peer(peer)
|
, _peer(peer)
|
||||||
|
, _customStatusLoopsLimit(customStatusLoopsLimit)
|
||||||
, _allowed(allowed)
|
, _allowed(allowed)
|
||||||
, _animationPaused(std::move(animationPaused)) {
|
, _animationPaused(std::move(animationPaused)) {
|
||||||
rpl::combine(
|
rpl::combine(
|
||||||
|
@ -144,6 +146,11 @@ void BadgeView::setBadge(Badge badge, DocumentId emojiStatusId) {
|
||||||
_emojiStatusId,
|
_emojiStatusId,
|
||||||
[raw = _view.data()] { raw->update(); },
|
[raw = _view.data()] { raw->update(); },
|
||||||
tag);
|
tag);
|
||||||
|
if (_customStatusLoopsLimit > 0) {
|
||||||
|
_emojiStatus = std::make_unique<Ui::Text::LimitedLoopsEmoji>(
|
||||||
|
std::move(_emojiStatus),
|
||||||
|
_customStatusLoopsLimit);
|
||||||
|
}
|
||||||
_emojiStatusColored = std::make_unique<
|
_emojiStatusColored = std::make_unique<
|
||||||
Ui::Text::CustomEmojiColored
|
Ui::Text::CustomEmojiColored
|
||||||
>();
|
>();
|
||||||
|
|
|
@ -61,6 +61,7 @@ public:
|
||||||
const style::InfoPeerBadge &st,
|
const style::InfoPeerBadge &st,
|
||||||
not_null<PeerData*> peer,
|
not_null<PeerData*> peer,
|
||||||
Fn<bool()> animationPaused,
|
Fn<bool()> animationPaused,
|
||||||
|
int customStatusLoopsLimit = 0,
|
||||||
base::flags<Badge> allowed = base::flags<Badge>::from_raw(-1));
|
base::flags<Badge> allowed = base::flags<Badge>::from_raw(-1));
|
||||||
|
|
||||||
[[nodiscard]] Ui::RpWidget *widget() const;
|
[[nodiscard]] Ui::RpWidget *widget() const;
|
||||||
|
@ -75,6 +76,7 @@ private:
|
||||||
const not_null<QWidget*> _parent;
|
const not_null<QWidget*> _parent;
|
||||||
const style::InfoPeerBadge &_st;
|
const style::InfoPeerBadge &_st;
|
||||||
const not_null<PeerData*> _peer;
|
const not_null<PeerData*> _peer;
|
||||||
|
const int _customStatusLoopsLimit = 0;
|
||||||
DocumentId _emojiStatusId = 0;
|
DocumentId _emojiStatusId = 0;
|
||||||
std::unique_ptr<Ui::Text::CustomEmoji> _emojiStatus;
|
std::unique_ptr<Ui::Text::CustomEmoji> _emojiStatus;
|
||||||
std::unique_ptr<Ui::Text::CustomEmojiColored> _emojiStatusColored;
|
std::unique_ptr<Ui::Text::CustomEmojiColored> _emojiStatusColored;
|
||||||
|
|
|
@ -64,6 +64,7 @@ namespace Settings {
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
constexpr auto kSaveBioTimeout = 1000;
|
constexpr auto kSaveBioTimeout = 1000;
|
||||||
|
constexpr auto kPlayStatusLimit = 2;
|
||||||
|
|
||||||
class ComposedBadge final : public Ui::RpWidget {
|
class ComposedBadge final : public Ui::RpWidget {
|
||||||
public:
|
public:
|
||||||
|
@ -99,6 +100,7 @@ ComposedBadge::ComposedBadge(
|
||||||
st::settingsInfoPeerBadge,
|
st::settingsInfoPeerBadge,
|
||||||
session->user(),
|
session->user(),
|
||||||
std::move(animationPaused),
|
std::move(animationPaused),
|
||||||
|
kPlayStatusLimit,
|
||||||
Info::Profile::Badge::Premium) {
|
Info::Profile::Badge::Premium) {
|
||||||
if (hasUnread) {
|
if (hasUnread) {
|
||||||
_unread = CreateUnread(this, rpl::single(
|
_unread = CreateUnread(this, rpl::single(
|
||||||
|
|
|
@ -114,6 +114,7 @@ Cover::Cover(
|
||||||
return controller->isGifPausedAtLeastFor(
|
return controller->isGifPausedAtLeastFor(
|
||||||
Window::GifPauseReason::Layer);
|
Window::GifPauseReason::Layer);
|
||||||
},
|
},
|
||||||
|
0, // customStatusLoopsLimit
|
||||||
Info::Profile::Badge::Premium)
|
Info::Profile::Badge::Premium)
|
||||||
, _userpic(
|
, _userpic(
|
||||||
this,
|
this,
|
||||||
|
|
|
@ -73,6 +73,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
namespace Window {
|
namespace Window {
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
|
constexpr auto kPlayStatusLimit = 2;
|
||||||
|
|
||||||
void ShowCallsBox(not_null<Window::SessionController*> window) {
|
void ShowCallsBox(not_null<Window::SessionController*> window) {
|
||||||
auto controller = std::make_unique<Calls::BoxController>(window);
|
auto controller = std::make_unique<Calls::BoxController>(window);
|
||||||
const auto initBox = [
|
const auto initBox = [
|
||||||
|
@ -341,6 +343,7 @@ MainMenu::MainMenu(
|
||||||
st::settingsInfoPeerBadge,
|
st::settingsInfoPeerBadge,
|
||||||
controller->session().user(),
|
controller->session().user(),
|
||||||
[=] { return controller->isGifPausedAtLeastFor(GifPauseReason::Layer); },
|
[=] { return controller->isGifPausedAtLeastFor(GifPauseReason::Layer); },
|
||||||
|
kPlayStatusLimit,
|
||||||
Info::Profile::Badge::Premium))
|
Info::Profile::Badge::Premium))
|
||||||
, _emojiStatusPanel(std::make_unique<Info::Profile::EmojiStatusPanel>())
|
, _emojiStatusPanel(std::make_unique<Info::Profile::EmojiStatusPanel>())
|
||||||
, _scroll(this, st::defaultSolidScroll)
|
, _scroll(this, st::defaultSolidScroll)
|
||||||
|
|
Loading…
Add table
Reference in a new issue