Merge tag 'v5.1.2' into dev

# Conflicts:
#	Telegram/Resources/winrc/Telegram.rc
#	Telegram/Resources/winrc/Updater.rc
#	Telegram/SourceFiles/boxes/send_files_box.cpp
#	Telegram/SourceFiles/core/version.h
#	Telegram/SourceFiles/data/data_search_controller.cpp
#	Telegram/SourceFiles/dialogs/dialogs_widget.cpp
#	Telegram/SourceFiles/dialogs/dialogs_widget.h
#	Telegram/SourceFiles/history/view/media/history_view_gif.cpp
#	Telegram/SourceFiles/mainwidget.cpp
#	Telegram/lib_ui
This commit is contained in:
AlexeyZavar
2024-06-04 03:27:24 +03:00
304 changed files with 13815 additions and 3704 deletions
@@ -13,6 +13,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "boxes/peers/edit_peer_info_box.h"
#include "boxes/peers/replace_boost_box.h"
#include "boxes/delete_messages_box.h"
#include "window/window_chat_preview.h"
#include "window/window_controller.h"
#include "window/window_filters_menu.h"
#include "info/channel_statistics/earn/info_earn_inner_widget.h"
@@ -22,7 +23,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "history/history.h"
#include "history/history_item.h"
#include "history/view/reactions/history_view_reactions.h"
#include "history/view/reactions/history_view_reactions_button.h"
//#include "history/view/reactions/history_view_reactions_button.h"
#include "history/view/history_view_replies_section.h"
#include "history/view/history_view_scheduled_section.h"
#include "media/player/media_player_instance.h"
@@ -58,6 +59,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "ui/text/format_values.h" // Ui::FormatPhone.
#include "ui/delayed_activation.h"
#include "ui/boxes/boost_box.h"
#include "ui/chat/chat_style.h"
#include "ui/chat/chat_theme.h"
#include "ui/effects/message_sending_animation_controller.h"
#include "ui/style/style_palette_colorizer.h"
@@ -125,7 +127,7 @@ public:
rpl::producer<> pauseChanged() const override;
rpl::producer<bool> adjustShadowLeft() const override;
SendMenu::Type sendMenuType() const override;
SendMenu::Details sendMenuDetails() const override;
bool showMediaPreview(
Data::FileOrigin origin,
@@ -275,12 +277,12 @@ rpl::producer<bool> MainWindowShow::adjustShadowLeft() const {
});
}
SendMenu::Type MainWindowShow::sendMenuType() const {
SendMenu::Details MainWindowShow::sendMenuDetails() const {
const auto window = _window.get();
if (!window) {
return SendMenu::Type::Disabled;
return SendMenu::Details();
}
return window->content()->sendMenuType();
return window->content()->sendMenuDetails();
}
bool MainWindowShow::showMediaPreview(
@@ -1182,6 +1184,7 @@ SessionController::SessionController(
, _window(window)
, _emojiInteractions(
std::make_unique<ChatHelpers::EmojiInteractions>(session))
, _chatPreviewManager(std::make_unique<ChatPreviewManager>(this))
, _isPrimary(window->isPrimary())
, _sendingAnimation(
std::make_unique<Ui::MessageSendingAnimationController>(this))
@@ -1194,7 +1197,6 @@ SessionController::SessionController(
, _activeChatsFilter(session->data().chatsFilters().defaultId())
, _defaultChatTheme(std::make_shared<Ui::ChatTheme>())
, _chatStyle(std::make_unique<Ui::ChatStyle>(session->colorIndicesValue()))
, _cachedReactionIconFactory(std::make_unique<ReactionIconFactory>())
, _giftPremiumValidator(this) {
init();
@@ -2959,7 +2961,7 @@ void SessionController::openPeerStories(
}
HistoryView::PaintContext SessionController::preparePaintContext(
PaintContextArgs &&args) {
Ui::ChatPaintContextArgs &&args) {
const auto visibleAreaTopLocal = content()->mapFromGlobal(
args.visibleAreaPositionGlobal).y();
const auto viewport = QRect(
@@ -2982,6 +2984,34 @@ QString SessionController::premiumRef() const {
return _premiumRef;
}
bool SessionController::showChatPreview(
Dialogs::RowDescriptor row,
Fn<void(bool shown)> callback,
QPointer<QWidget> parentOverride,
std::optional<QPoint> positionOverride) {
return _chatPreviewManager->show(
std::move(row),
std::move(callback),
std::move(parentOverride),
positionOverride);
}
bool SessionController::scheduleChatPreview(
Dialogs::RowDescriptor row,
Fn<void(bool shown)> callback,
QPointer<QWidget> parentOverride,
std::optional<QPoint> positionOverride) {
return _chatPreviewManager->schedule(
std::move(row),
std::move(callback),
std::move(parentOverride),
positionOverride);
}
void SessionController::cancelScheduledPreview() {
_chatPreviewManager->cancelScheduled();
}
bool SessionController::contentOverlapped(QWidget *w, QPaintEvent *e) const {
return widget()->contentOverlapped(w, e);
}