mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Added phrases to ttl viewer widget for video messages.
This commit is contained in:
parent
c686ac8603
commit
a2c0491ae0
2 changed files with 19 additions and 7 deletions
|
@ -1722,6 +1722,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
"lng_ttl_voice_tooltip_in" = "This voice message can only be played once.";
|
"lng_ttl_voice_tooltip_in" = "This voice message can only be played once.";
|
||||||
"lng_ttl_voice_tooltip_out" = "This message will disappear once **{user}** plays it once.";
|
"lng_ttl_voice_tooltip_out" = "This message will disappear once **{user}** plays it once.";
|
||||||
"lng_ttl_voice_close_in" = "Delete and close";
|
"lng_ttl_voice_close_in" = "Delete and close";
|
||||||
|
"lng_ttl_round_tooltip_in" = "This video message can only be played once.";
|
||||||
|
"lng_ttl_round_tooltip_out" = "This message will disappear once **{user}** plays it once.";
|
||||||
|
|
||||||
"lng_profile_add_more_after_create" = "You will be able to add more members after you create the group.";
|
"lng_profile_add_more_after_create" = "You will be able to add more members after you create the group.";
|
||||||
"lng_profile_camera_title" = "Capture yourself";
|
"lng_profile_camera_title" = "Capture yourself";
|
||||||
|
|
|
@ -8,6 +8,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
#include "chat_helpers/ttl_media_layer_widget.h"
|
#include "chat_helpers/ttl_media_layer_widget.h"
|
||||||
|
|
||||||
#include "base/event_filter.h"
|
#include "base/event_filter.h"
|
||||||
|
#include "data/data_document.h"
|
||||||
#include "data/data_session.h"
|
#include "data/data_session.h"
|
||||||
#include "editor/editor_layer_widget.h"
|
#include "editor/editor_layer_widget.h"
|
||||||
#include "history/history.h"
|
#include "history/history.h"
|
||||||
|
@ -123,6 +124,11 @@ PreviewWrap::PreviewWrap(
|
||||||
_style.get(),
|
_style.get(),
|
||||||
[=] { update(elementRect()); })) {
|
[=] { update(elementRect()); })) {
|
||||||
|
|
||||||
|
const auto isRound = _item
|
||||||
|
&& _item->media()
|
||||||
|
&& _item->media()->document()
|
||||||
|
&& _item->media()->document()->isVideoMessage();
|
||||||
|
|
||||||
std::move(
|
std::move(
|
||||||
theme
|
theme
|
||||||
) | rpl::start_with_next([=](std::shared_ptr<Ui::ChatTheme> theme) {
|
) | rpl::start_with_next([=](std::shared_ptr<Ui::ChatTheme> theme) {
|
||||||
|
@ -174,13 +180,17 @@ PreviewWrap::PreviewWrap(
|
||||||
|
|
||||||
{
|
{
|
||||||
auto text = item->out()
|
auto text = item->out()
|
||||||
? tr::lng_ttl_voice_tooltip_out(
|
? (isRound
|
||||||
lt_user,
|
? tr::lng_ttl_round_tooltip_out
|
||||||
rpl::single(
|
: tr::lng_ttl_voice_tooltip_out)(
|
||||||
item->history()->peer->name()
|
lt_user,
|
||||||
) | rpl::map(Ui::Text::RichLangValue),
|
rpl::single(
|
||||||
Ui::Text::RichLangValue)
|
item->history()->peer->shortName()
|
||||||
: tr::lng_ttl_voice_tooltip_in(Ui::Text::RichLangValue);
|
) | rpl::map(Ui::Text::RichLangValue),
|
||||||
|
Ui::Text::RichLangValue)
|
||||||
|
: (isRound
|
||||||
|
? tr::lng_ttl_round_tooltip_in
|
||||||
|
: tr::lng_ttl_voice_tooltip_in)(Ui::Text::RichLangValue);
|
||||||
const auto tooltip = Ui::CreateChild<Ui::ImportantTooltip>(
|
const auto tooltip = Ui::CreateChild<Ui::ImportantTooltip>(
|
||||||
this,
|
this,
|
||||||
object_ptr<Ui::PaddingWrap<Ui::FlatLabel>>(
|
object_ptr<Ui::PaddingWrap<Ui::FlatLabel>>(
|
||||||
|
|
Loading…
Add table
Reference in a new issue