diff --git a/Telegram/SourceFiles/chat_helpers/chat_helpers.style b/Telegram/SourceFiles/chat_helpers/chat_helpers.style index cb2a2f081..4b66b507f 100644 --- a/Telegram/SourceFiles/chat_helpers/chat_helpers.style +++ b/Telegram/SourceFiles/chat_helpers/chat_helpers.style @@ -1521,17 +1521,17 @@ sendGifBox: Box(defaultBox) { } processingVideoTipMaxWidth: 364px; -processingVideoTipShift: 10px; +processingVideoTipShift: 8px; processingVideoToast: Toast(defaultToast) { minWidth: 32px; maxWidth: 380px; - padding: margins(19px, 17px, 19px, 16px); + padding: margins(19px, 17px, 19px, 17px); } -processingVideoPreviewSkip: 0px; +processingVideoPreviewSkip: 8px; processingVideoView: RoundButton(defaultActiveButton) { width: -24px; - height: 68px; - textTop: 26px; + height: 52px; + textTop: 17px; textFg: mediaviewTextLinkFg; textFgOver: mediaviewTextLinkFg; textBg: transparent; diff --git a/Telegram/SourceFiles/history/history_item.cpp b/Telegram/SourceFiles/history/history_item.cpp index 8c0185f28..b588c485d 100644 --- a/Telegram/SourceFiles/history/history_item.cpp +++ b/Telegram/SourceFiles/history/history_item.cpp @@ -2212,6 +2212,10 @@ bool HistoryItem::allowsSendNow() const { && !isEditingMedia(); } +bool HistoryItem::allowsReschedule() const { + return allowsSendNow() && !awaitingVideoProcessing(); +} + bool HistoryItem::allowsForward() const { return !isService() && isRegular() @@ -2236,7 +2240,8 @@ bool HistoryItem::allowsEdit(TimeId now) const { } bool HistoryItem::allowsEditMedia() const { - return !_media || _media->allowsEditMedia(); + return !awaitingVideoProcessing() + && (!_media || _media->allowsEditMedia()); } bool HistoryItem::canBeEdited() const { diff --git a/Telegram/SourceFiles/history/history_item.h b/Telegram/SourceFiles/history/history_item.h index 6182fa60c..9a17be15f 100644 --- a/Telegram/SourceFiles/history/history_item.h +++ b/Telegram/SourceFiles/history/history_item.h @@ -429,6 +429,7 @@ public: [[nodiscard]] bool forbidsForward() const; [[nodiscard]] bool forbidsSaving() const; [[nodiscard]] bool allowsSendNow() const; + [[nodiscard]] bool allowsReschedule() const; [[nodiscard]] bool allowsForward() const; [[nodiscard]] bool allowsEdit(TimeId now) const; [[nodiscard]] bool allowsEditMedia() const; diff --git a/Telegram/SourceFiles/history/view/history_view_context_menu.cpp b/Telegram/SourceFiles/history/view/history_view_context_menu.cpp index e34cab589..a9c699188 100644 --- a/Telegram/SourceFiles/history/view/history_view_context_menu.cpp +++ b/Telegram/SourceFiles/history/view/history_view_context_menu.cpp @@ -522,7 +522,7 @@ bool AddRescheduleAction( const auto owner = &request.navigation->session().data(); const auto goodSingle = HasEditMessageAction(request, list) - && request.item->isScheduled(); + && request.item->allowsReschedule(); const auto goodMany = [&] { if (goodSingle) { return false; @@ -534,7 +534,7 @@ bool AddRescheduleAction( if (items.size() > kRescheduleLimit) { return false; } - return ranges::all_of(items, &SelectedItem::canSendNow); + return ranges::all_of(items, &SelectedItem::canReschedule); }(); if (!goodSingle && !goodMany) { return false; diff --git a/Telegram/SourceFiles/history/view/history_view_list_widget.cpp b/Telegram/SourceFiles/history/view/history_view_list_widget.cpp index 2e2c087b0..b4e6fd86e 100644 --- a/Telegram/SourceFiles/history/view/history_view_list_widget.cpp +++ b/Telegram/SourceFiles/history/view/history_view_list_widget.cpp @@ -1183,6 +1183,7 @@ auto ListWidget::collectSelectedItems() const -> SelectedItems { result.canDelete = selection.canDelete; result.canForward = selection.canForward; result.canSendNow = selection.canSendNow; + result.canReschedule = selection.canReschedule; return result; }; auto items = SelectedItems(); @@ -1317,6 +1318,7 @@ bool ListWidget::addToSelection( iterator->second.canDelete = item->canDelete(); iterator->second.canForward = item->allowsForward(); iterator->second.canSendNow = item->allowsSendNow(); + iterator->second.canReschedule = item->allowsReschedule(); return true; } diff --git a/Telegram/SourceFiles/history/view/history_view_list_widget.h b/Telegram/SourceFiles/history/view/history_view_list_widget.h index 02ec9a370..8fa1b1f52 100644 --- a/Telegram/SourceFiles/history/view/history_view_list_widget.h +++ b/Telegram/SourceFiles/history/view/history_view_list_widget.h @@ -80,6 +80,7 @@ struct SelectedItem { bool canDelete = false; bool canForward = false; bool canSendNow = false; + bool canReschedule = false; }; struct MessagesBar { @@ -232,6 +233,7 @@ struct SelectionData { bool canDelete = false; bool canForward = false; bool canSendNow = false; + bool canReschedule = false; }; using SelectedMap = base::flat_map<