Allow "Enlarge Video" / "Shrink Video".

This commit is contained in:
John Preston
2026-02-04 13:53:57 +04:00
parent ca2bb144b9
commit 1b26fea1e0
3 changed files with 14 additions and 3 deletions
+2
View File
@@ -5243,6 +5243,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_link_move_down" = "Move Down";
"lng_link_shrink_photo" = "Shrink Photo";
"lng_link_enlarge_photo" = "Enlarge Photo";
"lng_link_shrink_video" = "Shrink Video";
"lng_link_enlarge_video" = "Enlarge Video";
"lng_link_remove" = "Do Not Preview";
"lng_link_about_choose" = "Click on a link to generate its preview.";
+4 -1
View File
@@ -271,7 +271,10 @@ bool WebPageData::applyChanges(
const auto hasSiteName = !resultSiteName.isEmpty() ? 1 : 0;
const auto hasTitle = !resultTitle.isEmpty() ? 1 : 0;
const auto hasDescription = !newDescription.text.isEmpty() ? 1 : 0;
if (newDocument
const auto allowLargeMediaDocument = newDocument
&& newDocument->isVideoFile()
&& newPhoto;
if ((!allowLargeMediaDocument && newDocument)
|| !newCollage.items.empty()
|| !newPhoto
|| (hasSiteName + hasTitle + hasDescription < 2)) {
@@ -899,11 +899,17 @@ void DraftOptionsBox(
const auto small = state->webpage.forceSmallMedia
|| (!state->webpage.forceLargeMedia
&& state->preview->computeDefaultSmallMedia());
const auto hasVideo = state->preview->document
&& state->preview->document->isVideoFile();
Settings::AddButtonWithIcon(
bottom,
(small
? tr::lng_link_enlarge_photo()
: tr::lng_link_shrink_photo()),
? (hasVideo
? tr::lng_link_enlarge_video()
: tr::lng_link_enlarge_photo())
: (hasVideo
? tr::lng_link_shrink_video()
: tr::lng_link_shrink_photo())),
st::settingsButton,
{ small ? &st::menuIconEnlarge : &st::menuIconShrink }
)->setClickedCallback([=] {