mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Update icons for collectible wearing.
This commit is contained in:
parent
c6649e84a6
commit
de732ba692
14 changed files with 65 additions and 15 deletions
BIN
Telegram/Resources/icons/menu/nft_takeoff.png
Normal file
BIN
Telegram/Resources/icons/menu/nft_takeoff.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 730 B |
BIN
Telegram/Resources/icons/menu/nft_takeoff@2x.png
Normal file
BIN
Telegram/Resources/icons/menu/nft_takeoff@2x.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.4 KiB |
BIN
Telegram/Resources/icons/menu/nft_takeoff@3x.png
Normal file
BIN
Telegram/Resources/icons/menu/nft_takeoff@3x.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2 KiB |
BIN
Telegram/Resources/icons/menu/nft_wear.png
Normal file
BIN
Telegram/Resources/icons/menu/nft_wear.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 716 B |
BIN
Telegram/Resources/icons/menu/nft_wear@2x.png
Normal file
BIN
Telegram/Resources/icons/menu/nft_wear@2x.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.4 KiB |
BIN
Telegram/Resources/icons/menu/nft_wear@3x.png
Normal file
BIN
Telegram/Resources/icons/menu/nft_wear@3x.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.1 KiB |
|
@ -3379,6 +3379,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
"lng_gift_wear_proof_title" = "Proof of Ownership";
|
"lng_gift_wear_proof_title" = "Proof of Ownership";
|
||||||
"lng_gift_wear_proof_about" = "Clicking the icon of this item next to your name will show its info and owner.";
|
"lng_gift_wear_proof_about" = "Clicking the icon of this item next to your name will show its info and owner.";
|
||||||
"lng_gift_wear_start" = "Start Wearing";
|
"lng_gift_wear_start" = "Start Wearing";
|
||||||
|
"lng_gift_wear_subscribe" = "Subscribe to {link} to wear collectibles.";
|
||||||
"lng_gift_wear_start_toast" = "You put on {name}";
|
"lng_gift_wear_start_toast" = "You put on {name}";
|
||||||
"lng_gift_wear_end_toast" = "You took off {name}";
|
"lng_gift_wear_end_toast" = "You took off {name}";
|
||||||
|
|
||||||
|
|
|
@ -218,6 +218,9 @@ constexpr auto kRarityTooltipDuration = 3 * crl::time(1000);
|
||||||
state->content = EmojiStatusIdValue(
|
state->content = EmojiStatusIdValue(
|
||||||
peer
|
peer
|
||||||
) | rpl::map([=](EmojiStatusId emojiStatusId) {
|
) | rpl::map([=](EmojiStatusId emojiStatusId) {
|
||||||
|
if (!peer->session().premium()) {
|
||||||
|
return Badge::Content();
|
||||||
|
}
|
||||||
return Badge::Content{
|
return Badge::Content{
|
||||||
.badge = BadgeType::Premium,
|
.badge = BadgeType::Premium,
|
||||||
.emojiStatusId = emojiStatusId,
|
.emojiStatusId = emojiStatusId,
|
||||||
|
@ -232,7 +235,9 @@ constexpr auto kRarityTooltipDuration = 3 * crl::time(1000);
|
||||||
[=] { return show->paused(ChatHelpers::PauseReason::Layer); });
|
[=] { return show->paused(ChatHelpers::PauseReason::Layer); });
|
||||||
state->content.value(
|
state->content.value(
|
||||||
) | rpl::start_with_next([=](const Badge::Content &content) {
|
) | rpl::start_with_next([=](const Badge::Content &content) {
|
||||||
pushStatusId(badge->widget(), content.emojiStatusId);
|
if (const auto widget = badge->widget()) {
|
||||||
|
pushStatusId(widget, content.emojiStatusId);
|
||||||
|
}
|
||||||
}, raw->lifetime());
|
}, raw->lifetime());
|
||||||
|
|
||||||
rpl::combine(
|
rpl::combine(
|
||||||
|
@ -248,12 +253,14 @@ constexpr auto kRarityTooltipDuration = 3 * crl::time(1000);
|
||||||
label->moveToLeft(position.x(), position.y(), width);
|
label->moveToLeft(position.x(), position.y(), width);
|
||||||
const auto top = (raw->height() - userpic->height()) / 2;
|
const auto top = (raw->height() - userpic->height()) / 2;
|
||||||
userpic->moveToLeft(0, top, width);
|
userpic->moveToLeft(0, top, width);
|
||||||
badge->widget()->moveToLeft(
|
if (badgeWidget) {
|
||||||
position.x() + label->width() + st::normalFont->spacew,
|
badgeWidget->moveToLeft(
|
||||||
(position.y()
|
position.x() + label->width() + st::normalFont->spacew,
|
||||||
+ table->st().defaultValue.style.font->ascent
|
(position.y()
|
||||||
- table->st().smallButton.style.font->ascent),
|
+ table->st().defaultValue.style.font->ascent
|
||||||
width);
|
- table->st().smallButton.style.font->ascent),
|
||||||
|
width);
|
||||||
|
}
|
||||||
}, label->lifetime());
|
}, label->lifetime());
|
||||||
|
|
||||||
userpic->setAttribute(Qt::WA_TransparentForMouseEvents);
|
userpic->setAttribute(Qt::WA_TransparentForMouseEvents);
|
||||||
|
|
|
@ -30,6 +30,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
#include "data/data_document_media.h"
|
#include "data/data_document_media.h"
|
||||||
#include "data/data_emoji_statuses.h"
|
#include "data/data_emoji_statuses.h"
|
||||||
#include "data/data_file_origin.h"
|
#include "data/data_file_origin.h"
|
||||||
|
#include "data/data_peer_values.h"
|
||||||
#include "data/data_session.h"
|
#include "data/data_session.h"
|
||||||
#include "data/data_user.h"
|
#include "data/data_user.h"
|
||||||
#include "data/stickers/data_custom_emoji.h"
|
#include "data/stickers/data_custom_emoji.h"
|
||||||
|
@ -2362,20 +2363,52 @@ void ShowUniqueGiftWearBox(
|
||||||
// &st::menuIconUniqueProfile);
|
// &st::menuIconUniqueProfile);
|
||||||
infoRow(
|
infoRow(
|
||||||
tr::lng_gift_wear_proof_title(),
|
tr::lng_gift_wear_proof_title(),
|
||||||
tr::lng_gift_wear_proof_about(), // todo collectibles
|
tr::lng_gift_wear_proof_about(),
|
||||||
st.proofIcon ? st.proofIcon : &st::menuIconTradable);
|
st.proofIcon ? st.proofIcon : &st::menuIconFactcheck);
|
||||||
|
|
||||||
const auto button = box->addButton(tr::lng_gift_wear_start(), [=] {
|
const auto session = &show->session();
|
||||||
const auto session = &show->session();
|
const auto button = box->addButton(rpl::single(QString()), [=] {
|
||||||
if (session->premium()) {
|
if (session->premium()) {
|
||||||
box->closeBox();
|
box->closeBox();
|
||||||
session->data().emojiStatuses().set(
|
session->data().emojiStatuses().set(
|
||||||
session->user(),
|
session->user(),
|
||||||
session->data().emojiStatuses().fromUniqueGift(gift));
|
session->data().emojiStatuses().fromUniqueGift(gift));
|
||||||
} else {
|
} else {
|
||||||
ShowPremiumPreviewBox(show, PremiumFeature::EmojiStatus);
|
const auto link = Ui::Text::Bold(
|
||||||
|
tr::lng_send_as_premium_required_link(tr::now));
|
||||||
|
Settings::ShowPremiumPromoToast(
|
||||||
|
show,
|
||||||
|
tr::lng_gift_wear_subscribe(
|
||||||
|
tr::now,
|
||||||
|
lt_link,
|
||||||
|
Ui::Text::Link(link),
|
||||||
|
Ui::Text::WithEntities),
|
||||||
|
u"wear_collectibles"_q);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
const auto lock = Ui::Text::SingleCustomEmoji(
|
||||||
|
session->data().customEmojiManager().registerInternalEmoji(
|
||||||
|
st::historySendDisabledIcon,
|
||||||
|
st::giftBoxLockMargins,
|
||||||
|
true));
|
||||||
|
auto label = rpl::combine(
|
||||||
|
tr::lng_gift_wear_start(),
|
||||||
|
Data::AmPremiumValue(&show->session())
|
||||||
|
) | rpl::map([=](const QString &text, bool premium) {
|
||||||
|
auto result = TextWithEntities();
|
||||||
|
if (!premium) {
|
||||||
|
result.append(lock);
|
||||||
|
}
|
||||||
|
result.append(text);
|
||||||
|
return result;
|
||||||
|
});
|
||||||
|
SetButtonMarkedLabel(
|
||||||
|
button,
|
||||||
|
std::move(label),
|
||||||
|
session,
|
||||||
|
st::creditsBoxButtonLabel,
|
||||||
|
&st::giftBox.button.textFg);
|
||||||
|
|
||||||
rpl::combine(
|
rpl::combine(
|
||||||
box->widthValue(),
|
box->widthValue(),
|
||||||
button->widthValue()
|
button->widthValue()
|
||||||
|
|
|
@ -219,6 +219,8 @@ darkGiftCodeBox: Box(giveawayGiftCodeBox) {
|
||||||
darkGiftLink: icon {{ "menu/copy", groupCallMembersFg }};
|
darkGiftLink: icon {{ "menu/copy", groupCallMembersFg }};
|
||||||
darkGiftShare: icon {{ "menu/share", groupCallMembersFg }};
|
darkGiftShare: icon {{ "menu/share", groupCallMembersFg }};
|
||||||
darkGiftTransfer: icon {{ "chat/input_replace", groupCallMembersFg }};
|
darkGiftTransfer: icon {{ "chat/input_replace", groupCallMembersFg }};
|
||||||
|
darkGiftNftWear: icon {{ "menu/nft_wear", groupCallMembersFg }};
|
||||||
|
darkGiftNftTakeOff: icon {{ "menu/nft_takeoff", groupCallMembersFg }};
|
||||||
darkGiftPalette: TextPalette(defaultTextPalette) {
|
darkGiftPalette: TextPalette(defaultTextPalette) {
|
||||||
linkFg: mediaviewTextLinkFg;
|
linkFg: mediaviewTextLinkFg;
|
||||||
monoFg: groupCallMembersFg;
|
monoFg: groupCallMembersFg;
|
||||||
|
|
|
@ -871,13 +871,13 @@ void FillUniqueGiftMenu(
|
||||||
if (now && unique->slug == now->slug) {
|
if (now && unique->slug == now->slug) {
|
||||||
menu->addAction(tr::lng_gift_transfer_take_off(tr::now), [=] {
|
menu->addAction(tr::lng_gift_transfer_take_off(tr::now), [=] {
|
||||||
show->session().data().emojiStatuses().set(peer, {});
|
show->session().data().emojiStatuses().set(peer, {});
|
||||||
}, st.transfer ? st.transfer : &st::menuIconReplace);
|
}, st.takeoff ? st.takeoff : &st::menuIconNftTakeOff);
|
||||||
} else {
|
} else {
|
||||||
menu->addAction(tr::lng_gift_transfer_wear(tr::now), [=] {
|
menu->addAction(tr::lng_gift_transfer_wear(tr::now), [=] {
|
||||||
ShowUniqueGiftWearBox(show, *unique, st.giftWearBox
|
ShowUniqueGiftWearBox(show, *unique, st.giftWearBox
|
||||||
? *st.giftWearBox
|
? *st.giftWearBox
|
||||||
: GiftWearBoxStyleOverride());
|
: GiftWearBoxStyleOverride());
|
||||||
}, st.transfer ? st.transfer : &st::menuIconReplace);
|
}, st.wear ? st.wear : &st::menuIconNftWear);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -904,6 +904,8 @@ CreditsEntryBoxStyleOverrides DarkCreditsEntryBoxStyle() {
|
||||||
.link = &st::darkGiftLink,
|
.link = &st::darkGiftLink,
|
||||||
.share = &st::darkGiftShare,
|
.share = &st::darkGiftShare,
|
||||||
.transfer = &st::darkGiftTransfer,
|
.transfer = &st::darkGiftTransfer,
|
||||||
|
.wear = &st::darkGiftNftWear,
|
||||||
|
.takeoff = &st::darkGiftNftTakeOff,
|
||||||
.shareBox = std::make_shared<ShareBoxStyleOverrides>(
|
.shareBox = std::make_shared<ShareBoxStyleOverrides>(
|
||||||
DarkShareBoxStyle()),
|
DarkShareBoxStyle()),
|
||||||
.giftWearBox = std::make_shared<GiftWearBoxStyleOverride>(
|
.giftWearBox = std::make_shared<GiftWearBoxStyleOverride>(
|
||||||
|
|
|
@ -110,6 +110,8 @@ struct CreditsEntryBoxStyleOverrides {
|
||||||
const style::icon *link = nullptr;
|
const style::icon *link = nullptr;
|
||||||
const style::icon *share = nullptr;
|
const style::icon *share = nullptr;
|
||||||
const style::icon *transfer = nullptr;
|
const style::icon *transfer = nullptr;
|
||||||
|
const style::icon *wear = nullptr;
|
||||||
|
const style::icon *takeoff = nullptr;
|
||||||
std::shared_ptr<ShareBoxStyleOverrides> shareBox;
|
std::shared_ptr<ShareBoxStyleOverrides> shareBox;
|
||||||
std::shared_ptr<GiftWearBoxStyleOverride> giftWearBox;
|
std::shared_ptr<GiftWearBoxStyleOverride> giftWearBox;
|
||||||
};
|
};
|
||||||
|
|
|
@ -164,6 +164,7 @@ giftListAbout: FlatLabel(defaultFlatLabel) {
|
||||||
giftListAboutMargin: margins(12px, 24px, 12px, 24px);
|
giftListAboutMargin: margins(12px, 24px, 12px, 24px);
|
||||||
giftBoxEmojiToggleTop: 7px;
|
giftBoxEmojiToggleTop: 7px;
|
||||||
giftBoxLimitTop: 28px;
|
giftBoxLimitTop: 28px;
|
||||||
|
giftBoxLockMargins: margins(-2px, 1px, 0px, 0px);
|
||||||
|
|
||||||
creditsHistoryEntriesList: PeerList(defaultPeerList) {
|
creditsHistoryEntriesList: PeerList(defaultPeerList) {
|
||||||
padding: margins(
|
padding: margins(
|
||||||
|
@ -227,7 +228,7 @@ darkUpgradeGiftBox: Box(upgradeGiftBox) {
|
||||||
titleAdditionalFg: groupCallMemberNotJoinedStatus;
|
titleAdditionalFg: groupCallMemberNotJoinedStatus;
|
||||||
}
|
}
|
||||||
darkUpgradeGiftRadiant: icon{{ "menu/unique", groupCallMembersFg }};
|
darkUpgradeGiftRadiant: icon{{ "menu/unique", groupCallMembersFg }};
|
||||||
darkUpgradeGiftProof: icon{{ "menu/tradable", groupCallMembersFg }};
|
darkUpgradeGiftProof: icon{{ "menu/factcheck", groupCallMembersFg }};
|
||||||
darkUpgradeGiftInfoTitle: FlatLabel(defaultFlatLabel) {
|
darkUpgradeGiftInfoTitle: FlatLabel(defaultFlatLabel) {
|
||||||
textFg: groupCallMembersFg;
|
textFg: groupCallMembersFg;
|
||||||
}
|
}
|
||||||
|
|
|
@ -173,6 +173,8 @@ menuIconTransparent: icon {{ "menu/affiliate_transparent", menuIconColor }};
|
||||||
menuIconLike: icon {{ "menu/affiliate_simple", menuIconColor }};
|
menuIconLike: icon {{ "menu/affiliate_simple", menuIconColor }};
|
||||||
menuIconTradable: icon {{ "menu/tradable", menuIconColor }};
|
menuIconTradable: icon {{ "menu/tradable", menuIconColor }};
|
||||||
menuIconUnique: icon {{ "menu/unique", menuIconColor }};
|
menuIconUnique: icon {{ "menu/unique", menuIconColor }};
|
||||||
|
menuIconNftWear: icon {{ "menu/nft_wear", menuIconColor }};
|
||||||
|
menuIconNftTakeOff: icon {{ "menu/nft_takeoff", menuIconColor }};
|
||||||
|
|
||||||
menuIconTTLAny: icon {{ "menu/auto_delete_plain", menuIconColor }};
|
menuIconTTLAny: icon {{ "menu/auto_delete_plain", menuIconColor }};
|
||||||
menuIconTTLAnyTextPosition: point(11px, 22px);
|
menuIconTTLAnyTextPosition: point(11px, 22px);
|
||||||
|
|
Loading…
Add table
Reference in a new issue