mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2026-07-25 06:54:43 +00:00
Allow "Enlarge Video" / "Shrink Video".
This commit is contained in:
@@ -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.";
|
||||
|
||||
|
||||
@@ -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([=] {
|
||||
|
||||
Reference in New Issue
Block a user