2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 14:45:14 +00:00

Merge tag 'v4.15.3' into HEAD

This commit is contained in:
Ilya Fedin
2024-07-01 01:16:47 +04:00
4187 changed files with 279156 additions and 72772 deletions

View File

@@ -8,13 +8,9 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#pragma once
#include "base/weak_ptr.h"
#include "base/unique_qptr.h"
#include "chat_helpers/bot_command.h"
#include "ui/rp_widget.h"
#include "ui/effects/animations.h"
#include "media/player/media_player_float.h"
#include "mtproto/sender.h"
#include "data/data_pts_waiter.h"
struct HistoryMessageMarkupButton;
class MainWindow;
@@ -42,8 +38,10 @@ class Session;
} // namespace Main
namespace Data {
class Thread;
class WallPaper;
struct ForwardDraft;
class Forum;
} // namespace Data
namespace Dialogs {
@@ -70,6 +68,7 @@ struct Content;
} // namespace Export
namespace Ui {
class ChatTheme;
class ConfirmBox;
class ResizeArea;
class PlainShadow;
@@ -86,6 +85,7 @@ class TopBarWrapWidget;
class SectionMemento;
class SectionWidget;
class AbstractSectionWidget;
class SlideAnimation;
class ConnectionState;
struct SectionSlideParams;
struct SectionShow;
@@ -111,8 +111,7 @@ class ItemBase;
class MainWidget
: public Ui::RpWidget
, private Media::Player::FloatDelegate
, private base::Subscriber {
, private Media::Player::FloatDelegate {
public:
using SectionShow = Window::SectionShow;
@@ -135,16 +134,17 @@ public:
void returnTabbedSelector();
void showAnimated(const QPixmap &bgAnimCache, bool back = false);
void showAnimated(QPixmap oldContentCache, bool back = false);
void activate();
void windowShown();
void dialogsToUp();
void checkHistoryActivation();
void checkActivation();
PeerData *peer();
[[nodiscard]] PeerData *peer() const;
[[nodiscard]] Ui::ChatTheme *customChatTheme() const;
int backgroundFromY() const;
void showSection(
@@ -164,29 +164,27 @@ public:
not_null<DocumentData*> document,
Api::SendOptions options);
bool isActive() const;
[[nodiscard]] bool doWeMarkAsRead() const;
[[nodiscard]] bool animatingShow() const;
void saveFieldToHistoryLocalDraft();
void showDragForwardInfo();
void hideDragForwardInfo();
void showForwardLayer(Data::ForwardDraft &&draft);
void showSendPathsLayer();
void shareUrlLayer(const QString &url, const QString &text);
void inlineSwitchLayer(const QString &botAndQuery);
void hiderLayer(base::unique_qptr<Window::HistoryHider> h);
bool setForwardDraft(PeerId peer, Data::ForwardDraft &&draft);
bool setForwardDraft(
not_null<Data::Thread*> thread,
Data::ForwardDraft &&draft);
bool sendPaths(
not_null<Data::Thread*> thread,
const QStringList &paths);
bool shareUrl(
PeerId peerId,
not_null<Data::Thread*> thread,
const QString &url,
const QString &text);
bool inlineSwitchChosen(PeerId peerId, const QString &botAndQuery);
bool sendPaths(PeerId peerId);
void onFilesOrForwardDrop(const PeerId &peer, const QMimeData *data);
bool selectingPeer() const;
const QString &text) const;
bool filesOrForwardDrop(
not_null<Data::Thread*> thread,
not_null<const QMimeData*> data);
void sendBotCommand(Bot::SendCommandRequest request);
void hideSingleUseKeyboard(PeerData *peer, MsgId replyTo);
bool insertBotCommand(const QString &cmd);
void hideSingleUseKeyboard(FullMsgId replyToId);
void searchMessages(const QString &query, Dialogs::Key inChat, UserData *from = nullptr);
@@ -198,8 +196,6 @@ public:
void checkChatBackground();
Image *newBackgroundThumb();
// Does offerPeer or showPeerHistory.
void choosePeer(PeerId peerId, MsgId showAtMsgId);
void clearBotStartToken(PeerData *peer);
void ctrlEnterSubmitUpdated();
@@ -207,8 +203,6 @@ public:
bool contentOverlapped(const QRect &globalRect);
void searchInChat(Dialogs::Key chat);
void mentionUser(PeerData *peer);
void showChooseReportMessages(
@@ -217,19 +211,23 @@ public:
Fn<void(MessageIdsList)> done);
void clearChooseReportMessages();
void toggleChooseChatTheme(not_null<PeerData*> peer);
void toggleChooseChatTheme(
not_null<PeerData*> peer,
std::optional<bool> show);
void ui_showPeerHistory(
void showHistory(
PeerId peer,
const SectionShow &params,
MsgId msgId);
void showMessage(
not_null<const HistoryItem*> item,
const SectionShow &params);
void showForum(not_null<Data::Forum*> forum, const SectionShow &params);
bool notify_switchInlineBotButtonReceived(const QString &query, UserData *samePeerBot, MsgId samePeerReplyTo);
void notify_showScheduledButtonChanged();
using FloatDelegate::floatPlayerAreaUpdated;
void closeBothPlayers();
void stopAndClosePlayer();
bool preventsCloseSection(Fn<void()> callback) const;
@@ -246,7 +244,7 @@ protected:
bool eventFilter(QObject *o, QEvent *e) override;
private:
void animationCallback();
void showFinished();
void handleAdaptiveLayoutUpdate();
void updateWindowAdaptiveLayout();
void handleAudioUpdate(const Media::Player::TrackState &state);
@@ -289,18 +287,24 @@ private:
Window::SectionSlideParams prepareHistoryAnimation(PeerId historyPeerId);
Window::SectionSlideParams prepareDialogsAnimation();
void saveSectionInStack();
bool saveSectionInStack(
const SectionShow &params,
Window::SectionWidget *newMainSection = nullptr);
int getMainSectionTop() const;
int getThirdSectionTop() const;
void hideAll();
void showAll();
void hiderLayer(base::unique_qptr<Window::HistoryHider> h);
void clearHider(not_null<Window::HistoryHider*> instance);
void closeBothPlayers();
[[nodiscard]] auto floatPlayerDelegate()
-> not_null<Media::Player::FloatDelegate*>;
not_null<Ui::RpWidget*> floatPlayerWidget() override;
void floatPlayerToggleGifsPaused(bool paused) override;
not_null<Media::Player::FloatSectionDelegate*> floatPlayerGetSection(
Window::Column column) override;
void floatPlayerEnumerateSections(Fn<void(
@@ -339,9 +343,7 @@ private:
const not_null<Window::SessionController*> _controller;
Ui::Animations::Simple _a_show;
bool _showBack = false;
QPixmap _cacheUnder, _cacheOver;
std::unique_ptr<Window::SlideAnimation> _showAnimation;
int _dialogsWidth = 0;
int _thirdColumnWidth = 0;
@@ -387,7 +389,3 @@ private:
const std::unique_ptr<Core::Changelogs> _changelogs;
};
namespace App {
MainWidget *main();
} // namespace App