init
Some checks failed
Docker. / Ubuntu (push) Has been cancelled
User-agent updater. / User-agent (push) Failing after 15s
Lock Threads / lock (push) Failing after 10s
Waiting for answer. / waiting-for-answer (push) Failing after 22s
Needs user action. / needs-user-action (push) Failing after 8s
Can't reproduce. / cant-reproduce (push) Failing after 8s
Close stale issues and PRs / stale (push) Has been cancelled
Some checks failed
Docker. / Ubuntu (push) Has been cancelled
User-agent updater. / User-agent (push) Failing after 15s
Lock Threads / lock (push) Failing after 10s
Waiting for answer. / waiting-for-answer (push) Failing after 22s
Needs user action. / needs-user-action (push) Failing after 8s
Can't reproduce. / cant-reproduce (push) Failing after 8s
Close stale issues and PRs / stale (push) Has been cancelled
This commit is contained in:
64
Telegram/lib_ui/ui/paint/blobs.h
Normal file
64
Telegram/lib_ui/ui/paint/blobs.h
Normal file
@@ -0,0 +1,64 @@
|
||||
// This file is part of Desktop App Toolkit,
|
||||
// a set of libraries for developing nice desktop applications.
|
||||
//
|
||||
// For license and copyright information please follow this link:
|
||||
// https://github.com/desktop-app/legal/blob/master/LEGAL
|
||||
//
|
||||
#pragma once
|
||||
|
||||
#include "ui/effects/animation_value.h"
|
||||
#include "ui/paint/blob.h"
|
||||
|
||||
class Painter;
|
||||
|
||||
namespace Ui::Paint {
|
||||
|
||||
class Blobs final {
|
||||
public:
|
||||
struct BlobData {
|
||||
int segmentsCount = 0;
|
||||
float minScale = 0;
|
||||
float minRadius = 0;
|
||||
float maxRadius = 0;
|
||||
float speedScale = 0;
|
||||
float alpha = 0;
|
||||
float minSpeed = 0;
|
||||
float maxSpeed = 0;
|
||||
};
|
||||
|
||||
Blobs(
|
||||
std::vector<BlobData> blobDatas,
|
||||
float levelDuration,
|
||||
float maxLevel);
|
||||
|
||||
void setRadiusesAt(
|
||||
rpl::producer<Blob::Radiuses> &&radiuses,
|
||||
int index);
|
||||
Blob::Radiuses radiusesAt(int index);
|
||||
|
||||
void setLevel(float value);
|
||||
void resetLevel();
|
||||
void paint(QPainter &p, const QBrush &brush, float outerScale = 1.);
|
||||
void updateLevel(crl::time dt);
|
||||
|
||||
[[nodiscard]] float maxRadius() const;
|
||||
[[nodiscard]] int size() const;
|
||||
[[nodiscard]] float64 currentLevel() const;
|
||||
|
||||
static constexpr auto kHideBlobsDuration = 2000;
|
||||
|
||||
private:
|
||||
void init();
|
||||
|
||||
const float _maxLevel;
|
||||
|
||||
std::vector<BlobData> _blobDatas;
|
||||
std::vector<RadialBlob> _blobs;
|
||||
|
||||
anim::continuous_value _levelValue;
|
||||
|
||||
rpl::lifetime _lifetime;
|
||||
|
||||
};
|
||||
|
||||
} // namespace Ui::Paint
|
||||
Reference in New Issue
Block a user