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

Closed beta 10019014: New input fields design and animations.

This commit is contained in:
John Preston
2016-12-09 21:56:01 +03:00
parent 2d48cde27a
commit 90234cb7a0
51 changed files with 1068 additions and 940 deletions

View File

@@ -32,9 +32,31 @@ class ItemBase;
} // namespace InlineBots
namespace App {
namespace internal {
void CallDelayed(int duration, base::lambda<void()> &&lambda);
} // namespace internal
template <int N, typename Lambda>
inline void CallDelayed(int duration, base::internal::lambda_guard<N, Lambda> &&guarded) {
return internal::CallDelayed(duration, [guarded = std_::move(guarded)] { guarded(); });
}
template <typename Pointer, typename ...PointersAndLambda>
inline void CallDelayed(int duration, Pointer &&qobject, PointersAndLambda&&... qobjectsAndLambda) {
auto guarded = base::lambda_guarded(std_::forward<Pointer>(qobject), std_::forward<PointersAndLambda>(qobjectsAndLambda)...);
return CallDelayed(duration, std_::move(guarded));
}
template <typename ...PointersAndLambda>
inline base::lambda<void()> LambdaDelayed(int duration, PointersAndLambda&&... qobjectsAndLambda) {
auto guarded = base::lambda_guarded(std_::forward<PointersAndLambda>(qobjectsAndLambda)...);
return [guarded = std_::move(guarded), duration] {
CallDelayed(duration, guarded.clone());
};
}
void sendBotCommand(PeerData *peer, UserData *bot, const QString &cmd, MsgId replyTo = 0);
bool insertBotCommand(const QString &cmd, bool specialGif = false);
void activateBotCommand(const HistoryItem *msg, int row, int col);