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
64 lines
1.2 KiB
C++
64 lines
1.2 KiB
C++
/*
|
|
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
|
|
|
|
namespace Ui {
|
|
class RpWidget;
|
|
} // namespace Ui
|
|
|
|
namespace Media::View {
|
|
class PlaybackProgress;
|
|
} // namespace Media::View
|
|
|
|
namespace Media::Player {
|
|
struct TrackState;
|
|
} // namespace Media::Player
|
|
|
|
namespace Media::Stories {
|
|
|
|
class Controller;
|
|
|
|
struct SliderData {
|
|
int index = 0;
|
|
int total = 0;
|
|
bool videoStream = false;
|
|
|
|
friend inline auto operator<=>(SliderData, SliderData) = default;
|
|
friend inline bool operator==(SliderData, SliderData) = default;
|
|
};
|
|
|
|
class Slider final {
|
|
public:
|
|
explicit Slider(not_null<Controller*> controller);
|
|
~Slider();
|
|
|
|
void show(SliderData data);
|
|
void raise();
|
|
|
|
void updatePlayback(const Player::TrackState &state);
|
|
|
|
private:
|
|
void resetProgress();
|
|
|
|
void layout(int width);
|
|
void paint(QRectF clip);
|
|
|
|
const not_null<Controller*> _controller;
|
|
const std::unique_ptr<Media::View::PlaybackProgress> _progress;
|
|
|
|
std::unique_ptr<Ui::RpWidget> _widget;
|
|
std::vector<QRectF> _rects;
|
|
QRect _activeBoundingRect;
|
|
|
|
SliderData _data;
|
|
|
|
|
|
};
|
|
|
|
} // namespace Media::Stories
|