mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-08-31 14:38:15 +00:00
Implement animated spoilers.
This commit is contained in:
@@ -36,6 +36,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
#include "ui/cached_round_corners.h"
|
||||
#include "ui/text/format_values.h" // Ui::FormatPhone
|
||||
#include "ui/text/text_utilities.h"
|
||||
#include "ui/painter.h"
|
||||
#include "window/section_widget.h"
|
||||
#include "window/window_controller.h"
|
||||
#include "window/window_session_controller.h"
|
||||
@@ -197,7 +198,7 @@ AdminLog::OwnedItem GenerateForwardedItem(
|
||||
|
||||
struct ForwardedTooltip {
|
||||
QRect geometry;
|
||||
Fn<void(Painter&)> paint;
|
||||
Fn<void(QPainter&)> paint;
|
||||
};
|
||||
[[nodiscard]] ForwardedTooltip PrepareForwardedTooltip(
|
||||
not_null<HistoryView::Element*> view,
|
||||
@@ -276,7 +277,7 @@ struct ForwardedTooltip {
|
||||
{ line, line, line, line + arrowSize });
|
||||
const auto origin = full.topLeft();
|
||||
|
||||
const auto paint = [=](Painter &p) {
|
||||
const auto paint = [=](QPainter &p) {
|
||||
p.translate(-origin);
|
||||
|
||||
Ui::FillRoundRect(
|
||||
@@ -918,7 +919,7 @@ object_ptr<Ui::RpWidget> ForwardsPrivacyController::setupAboveWidget(
|
||||
state->tooltip->paintRequest(
|
||||
) | rpl::start_with_next([=] {
|
||||
if (state->info.paint) {
|
||||
auto p = Painter(state->tooltip.get());
|
||||
auto p = QPainter(state->tooltip.get());
|
||||
state->info.paint(p);
|
||||
}
|
||||
}, state->tooltip->lifetime());
|
||||
|
Reference in New Issue
Block a user