mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-14 05:07:10 +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_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_subscribe" = "Subscribe to {link} to wear collectibles.";
|
||||
"lng_gift_wear_start_toast" = "You put on {name}";
|
||||
"lng_gift_wear_end_toast" = "You took off {name}";
|
||||
|
||||
|
|
|
@ -218,6 +218,9 @@ constexpr auto kRarityTooltipDuration = 3 * crl::time(1000);
|
|||
state->content = EmojiStatusIdValue(
|
||||
peer
|
||||
) | rpl::map([=](EmojiStatusId emojiStatusId) {
|
||||
if (!peer->session().premium()) {
|
||||
return Badge::Content();
|
||||
}
|
||||
return Badge::Content{
|
||||
.badge = BadgeType::Premium,
|
||||
.emojiStatusId = emojiStatusId,
|
||||
|
@ -232,7 +235,9 @@ constexpr auto kRarityTooltipDuration = 3 * crl::time(1000);
|
|||
[=] { return show->paused(ChatHelpers::PauseReason::Layer); });
|
||||
state->content.value(
|
||||
) | 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());
|
||||
|
||||
rpl::combine(
|
||||
|
@ -248,12 +253,14 @@ constexpr auto kRarityTooltipDuration = 3 * crl::time(1000);
|
|||
label->moveToLeft(position.x(), position.y(), width);
|
||||
const auto top = (raw->height() - userpic->height()) / 2;
|
||||
userpic->moveToLeft(0, top, width);
|
||||
badge->widget()->moveToLeft(
|
||||
position.x() + label->width() + st::normalFont->spacew,
|
||||
(position.y()
|
||||
+ table->st().defaultValue.style.font->ascent
|
||||
- table->st().smallButton.style.font->ascent),
|
||||
width);
|
||||
if (badgeWidget) {
|
||||
badgeWidget->moveToLeft(
|
||||
position.x() + label->width() + st::normalFont->spacew,
|
||||
(position.y()
|
||||
+ table->st().defaultValue.style.font->ascent
|
||||
- table->st().smallButton.style.font->ascent),
|
||||
width);
|
||||
}
|
||||
}, label->lifetime());
|
||||
|
||||
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_emoji_statuses.h"
|
||||
#include "data/data_file_origin.h"
|
||||
#include "data/data_peer_values.h"
|
||||
#include "data/data_session.h"
|
||||
#include "data/data_user.h"
|
||||
#include "data/stickers/data_custom_emoji.h"
|
||||
|
@ -2362,20 +2363,52 @@ void ShowUniqueGiftWearBox(
|
|||
// &st::menuIconUniqueProfile);
|
||||
infoRow(
|
||||
tr::lng_gift_wear_proof_title(),
|
||||
tr::lng_gift_wear_proof_about(), // todo collectibles
|
||||
st.proofIcon ? st.proofIcon : &st::menuIconTradable);
|
||||
tr::lng_gift_wear_proof_about(),
|
||||
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()) {
|
||||
box->closeBox();
|
||||
session->data().emojiStatuses().set(
|
||||
session->user(),
|
||||
session->data().emojiStatuses().fromUniqueGift(gift));
|
||||
} 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(
|
||||
box->widthValue(),
|
||||
button->widthValue()
|
||||
|
|
|
@ -219,6 +219,8 @@ darkGiftCodeBox: Box(giveawayGiftCodeBox) {
|
|||
darkGiftLink: icon {{ "menu/copy", groupCallMembersFg }};
|
||||
darkGiftShare: icon {{ "menu/share", groupCallMembersFg }};
|
||||
darkGiftTransfer: icon {{ "chat/input_replace", groupCallMembersFg }};
|
||||
darkGiftNftWear: icon {{ "menu/nft_wear", groupCallMembersFg }};
|
||||
darkGiftNftTakeOff: icon {{ "menu/nft_takeoff", groupCallMembersFg }};
|
||||
darkGiftPalette: TextPalette(defaultTextPalette) {
|
||||
linkFg: mediaviewTextLinkFg;
|
||||
monoFg: groupCallMembersFg;
|
||||
|
|
|
@ -871,13 +871,13 @@ void FillUniqueGiftMenu(
|
|||
if (now && unique->slug == now->slug) {
|
||||
menu->addAction(tr::lng_gift_transfer_take_off(tr::now), [=] {
|
||||
show->session().data().emojiStatuses().set(peer, {});
|
||||
}, st.transfer ? st.transfer : &st::menuIconReplace);
|
||||
}, st.takeoff ? st.takeoff : &st::menuIconNftTakeOff);
|
||||
} else {
|
||||
menu->addAction(tr::lng_gift_transfer_wear(tr::now), [=] {
|
||||
ShowUniqueGiftWearBox(show, *unique, st.giftWearBox
|
||||
? *st.giftWearBox
|
||||
: GiftWearBoxStyleOverride());
|
||||
}, st.transfer ? st.transfer : &st::menuIconReplace);
|
||||
}, st.wear ? st.wear : &st::menuIconNftWear);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -904,6 +904,8 @@ CreditsEntryBoxStyleOverrides DarkCreditsEntryBoxStyle() {
|
|||
.link = &st::darkGiftLink,
|
||||
.share = &st::darkGiftShare,
|
||||
.transfer = &st::darkGiftTransfer,
|
||||
.wear = &st::darkGiftNftWear,
|
||||
.takeoff = &st::darkGiftNftTakeOff,
|
||||
.shareBox = std::make_shared<ShareBoxStyleOverrides>(
|
||||
DarkShareBoxStyle()),
|
||||
.giftWearBox = std::make_shared<GiftWearBoxStyleOverride>(
|
||||
|
|
|
@ -110,6 +110,8 @@ struct CreditsEntryBoxStyleOverrides {
|
|||
const style::icon *link = nullptr;
|
||||
const style::icon *share = nullptr;
|
||||
const style::icon *transfer = nullptr;
|
||||
const style::icon *wear = nullptr;
|
||||
const style::icon *takeoff = nullptr;
|
||||
std::shared_ptr<ShareBoxStyleOverrides> shareBox;
|
||||
std::shared_ptr<GiftWearBoxStyleOverride> giftWearBox;
|
||||
};
|
||||
|
|
|
@ -164,6 +164,7 @@ giftListAbout: FlatLabel(defaultFlatLabel) {
|
|||
giftListAboutMargin: margins(12px, 24px, 12px, 24px);
|
||||
giftBoxEmojiToggleTop: 7px;
|
||||
giftBoxLimitTop: 28px;
|
||||
giftBoxLockMargins: margins(-2px, 1px, 0px, 0px);
|
||||
|
||||
creditsHistoryEntriesList: PeerList(defaultPeerList) {
|
||||
padding: margins(
|
||||
|
@ -227,7 +228,7 @@ darkUpgradeGiftBox: Box(upgradeGiftBox) {
|
|||
titleAdditionalFg: groupCallMemberNotJoinedStatus;
|
||||
}
|
||||
darkUpgradeGiftRadiant: icon{{ "menu/unique", groupCallMembersFg }};
|
||||
darkUpgradeGiftProof: icon{{ "menu/tradable", groupCallMembersFg }};
|
||||
darkUpgradeGiftProof: icon{{ "menu/factcheck", groupCallMembersFg }};
|
||||
darkUpgradeGiftInfoTitle: FlatLabel(defaultFlatLabel) {
|
||||
textFg: groupCallMembersFg;
|
||||
}
|
||||
|
|
|
@ -173,6 +173,8 @@ menuIconTransparent: icon {{ "menu/affiliate_transparent", menuIconColor }};
|
|||
menuIconLike: icon {{ "menu/affiliate_simple", menuIconColor }};
|
||||
menuIconTradable: icon {{ "menu/tradable", 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 }};
|
||||
menuIconTTLAnyTextPosition: point(11px, 22px);
|
||||
|
|
Loading…
Add table
Reference in a new issue