mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2026-07-25 06:54:43 +00:00
Replaced unread voice dot indicator with svg.
Related commit: f4cbbb251f.
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="6px" height="6px" viewBox="0 0 6 6" xmlns="http://www.w3.org/2000/svg">
|
||||
<circle cx="3" cy="3" r="3" fill="#FFFFFF"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 179 B |
@@ -101,11 +101,11 @@ struct AlbumCounts {
|
||||
};
|
||||
|
||||
[[nodiscard]] TextWithEntities WithCaptionNotificationText(
|
||||
const QString &attachType,
|
||||
TextWithEntities attachType,
|
||||
const TextWithEntities &caption,
|
||||
bool hasMiniImages = false) {
|
||||
if (caption.text.isEmpty()) {
|
||||
return Ui::Text::Colorized(attachType);
|
||||
return Ui::Text::Colorized(std::move(attachType));
|
||||
}
|
||||
auto wrapped = st::wrap_rtl(caption);
|
||||
return hasMiniImages
|
||||
@@ -116,13 +116,23 @@ struct AlbumCounts {
|
||||
tr::lng_dialogs_text_media_wrapped(
|
||||
tr::now,
|
||||
lt_media,
|
||||
Ui::Text::Colorized(attachType),
|
||||
Ui::Text::Colorized(std::move(attachType)),
|
||||
tr::marked),
|
||||
lt_caption,
|
||||
wrapped,
|
||||
tr::marked);
|
||||
}
|
||||
|
||||
[[nodiscard]] TextWithEntities WithCaptionNotificationText(
|
||||
const QString &attachType,
|
||||
const TextWithEntities &caption,
|
||||
bool hasMiniImages = false) {
|
||||
return WithCaptionNotificationText(
|
||||
Ui::Text::WithEntities(attachType),
|
||||
caption,
|
||||
hasMiniImages);
|
||||
}
|
||||
|
||||
[[nodiscard]] QImage PreparePreviewImage(
|
||||
not_null<const Image*> image,
|
||||
ImageRoundRadius radius,
|
||||
@@ -1209,32 +1219,35 @@ ItemPreview MediaFile::toPreview(ToPreviewOptions options) const {
|
||||
}
|
||||
}
|
||||
}
|
||||
const auto type = [&] {
|
||||
const auto type = [&]() -> TextWithEntities {
|
||||
using namespace Ui::Text;
|
||||
if (_document->isVideoMessage()) {
|
||||
return (item->media() && item->media()->ttlSeconds())
|
||||
return WithEntities((item->media() && item->media()->ttlSeconds())
|
||||
? tr::lng_in_dlg_video_message_ttl(tr::now)
|
||||
: tr::lng_in_dlg_video_message(tr::now);
|
||||
: tr::lng_in_dlg_video_message(tr::now));
|
||||
} else if (_document->isAnimation()) {
|
||||
return u"GIF"_q;
|
||||
return WithEntities(u"GIF"_q);
|
||||
} else if (_document->isVideoFile()) {
|
||||
return tr::lng_in_dlg_video(tr::now);
|
||||
return WithEntities(tr::lng_in_dlg_video(tr::now));
|
||||
} else if (_document->isVoiceMessage()) {
|
||||
return (item->media() && item->media()->ttlSeconds())
|
||||
? tr::lng_in_dlg_voice_message_ttl(tr::now)
|
||||
: item->isUnreadMedia()
|
||||
? tr::lng_in_dlg_audio_unread(
|
||||
if (item->media() && item->media()->ttlSeconds()) {
|
||||
return WithEntities(
|
||||
tr::lng_in_dlg_voice_message_ttl(tr::now));
|
||||
} else if (item->isUnreadMedia()) {
|
||||
return tr::lng_in_dlg_audio_unread(
|
||||
tr::now,
|
||||
lt_emoji,
|
||||
QChar(0x25CF))
|
||||
: tr::lng_in_dlg_audio(tr::now);
|
||||
IconEmoji(&st::dialogsUnreadMediaDotEmoji),
|
||||
tr::rich);
|
||||
}
|
||||
return WithEntities(tr::lng_in_dlg_audio(tr::now));
|
||||
} else if (const auto name = FormatSongNameFor(_document).string();
|
||||
!name.isEmpty()) {
|
||||
return name;
|
||||
return WithEntities(name);
|
||||
} else if (_document->isAudioFile()) {
|
||||
return tr::lng_in_dlg_audio_file(tr::now);
|
||||
return WithEntities(tr::lng_in_dlg_audio_file(tr::now));
|
||||
}
|
||||
return tr::lng_in_dlg_file(tr::now);
|
||||
return WithEntities(tr::lng_in_dlg_file(tr::now));
|
||||
}();
|
||||
const auto caption = (options.hideCaption || options.ignoreMessageText)
|
||||
? TextWithEntities()
|
||||
|
||||
@@ -547,6 +547,11 @@ dialogsMiniPreviewSkip: 2px;
|
||||
dialogsMiniPreviewRight: 3px;
|
||||
dialogsMiniPlay: icon{{ "dialogs/dialogs_mini_play", videoPlayIconFg }};
|
||||
|
||||
dialogsUnreadMediaDotEmoji: IconEmoji {
|
||||
icon: icon{{ "dialogs/dialogs_unread_media_dot", dialogsTextFgService }};
|
||||
padding: margins(1px, 7px, 2px, 0px);
|
||||
}
|
||||
|
||||
dialogsMiniForward: DialogsMiniIcon {
|
||||
icon: ThreeStateIcon {
|
||||
icon: icon {{ "mini_forward", dialogsTextFg, point(0px, 1px) }};
|
||||
|
||||
@@ -644,20 +644,27 @@ TextWithEntities DropDisallowedCustomEmoji(
|
||||
if (to->session().premium() || to->isSelf()) {
|
||||
return text;
|
||||
}
|
||||
const auto isLocalIconEmoji = [](const EntityInText &entity) {
|
||||
return entity.data().startsWith(u"icon-emoji-"_q);
|
||||
};
|
||||
const auto channel = to->asMegagroup();
|
||||
const auto allowSetId = channel ? channel->mgInfo->emojiSet.id : 0;
|
||||
if (!allowSetId) {
|
||||
const auto predicate = [&](const EntityInText &entity) {
|
||||
return (entity.type() == EntityType::CustomEmoji)
|
||||
&& !isLocalIconEmoji(entity);
|
||||
};
|
||||
text.entities.erase(
|
||||
ranges::remove(
|
||||
text.entities,
|
||||
EntityType::CustomEmoji,
|
||||
&EntityInText::type),
|
||||
ranges::remove_if(text.entities, predicate),
|
||||
text.entities.end());
|
||||
} else {
|
||||
const auto predicate = [&](const EntityInText &entity) {
|
||||
if (entity.type() != EntityType::CustomEmoji) {
|
||||
return false;
|
||||
}
|
||||
if (isLocalIconEmoji(entity)) {
|
||||
return false;
|
||||
}
|
||||
if (const auto id = Data::ParseCustomEmojiData(entity.data())) {
|
||||
const auto document = to->owner().document(id);
|
||||
if (const auto sticker = document->sticker()) {
|
||||
|
||||
Reference in New Issue
Block a user