2024-09-02 20:14:33 +03:00
|
|
|
/*
|
|
|
|
This file is part of Telegram Desktop,
|
|
|
|
the official desktop application for the Telegram messaging service.
|
|
|
|
|
|
|
|
For license and copyright information please follow this link:
|
|
|
|
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
|
2025-02-19 00:21:05 +03:00
|
|
|
namespace Ui::Controls {
|
2024-09-02 20:14:33 +03:00
|
|
|
|
2025-02-19 00:21:05 +03:00
|
|
|
struct SwipeContextData final {
|
2025-03-21 10:48:25 +03:00
|
|
|
[[nodiscard]] bool empty() const {
|
|
|
|
return !ratio
|
|
|
|
&& !reachRatio
|
|
|
|
&& !translation
|
|
|
|
&& !cursorTop;
|
|
|
|
}
|
|
|
|
[[nodiscard]] explicit operator bool() const {
|
|
|
|
return !empty();
|
|
|
|
}
|
|
|
|
|
2024-09-02 20:14:33 +03:00
|
|
|
float64 ratio = 0.;
|
2024-09-03 10:19:41 +03:00
|
|
|
float64 reachRatio = 0.;
|
2024-09-02 20:14:33 +03:00
|
|
|
int64 msgBareId = 0;
|
2024-09-03 22:14:32 +04:00
|
|
|
int translation = 0;
|
2024-09-02 20:14:33 +03:00
|
|
|
int cursorTop = 0;
|
|
|
|
};
|
|
|
|
|
2025-02-17 15:13:56 +03:00
|
|
|
struct SwipeBackResult final {
|
|
|
|
rpl::lifetime lifetime;
|
2025-02-19 00:21:05 +03:00
|
|
|
Fn<void(SwipeContextData)> callback;
|
2025-02-17 15:13:56 +03:00
|
|
|
};
|
|
|
|
|
2025-02-19 00:21:05 +03:00
|
|
|
} // namespace Ui::Controls
|