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:
90
Telegram/SourceFiles/calls/group/calls_volume_item.h
Normal file
90
Telegram/SourceFiles/calls/group/calls_volume_item.h
Normal file
@@ -0,0 +1,90 @@
|
||||
/*
|
||||
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
|
||||
|
||||
#include "ui/rp_widget.h"
|
||||
#include "ui/widgets/menu/menu_item_base.h"
|
||||
|
||||
namespace Ui {
|
||||
class CrossLineAnimation;
|
||||
class MediaSlider;
|
||||
namespace Paint {
|
||||
class ArcsAnimation;
|
||||
} // namespace Paint
|
||||
} // namespace Ui
|
||||
|
||||
namespace Calls {
|
||||
|
||||
namespace Group {
|
||||
struct MuteRequest;
|
||||
struct VolumeRequest;
|
||||
struct ParticipantState;
|
||||
} // namespace Group
|
||||
|
||||
class MenuVolumeItem final : public Ui::Menu::ItemBase {
|
||||
public:
|
||||
MenuVolumeItem(
|
||||
not_null<RpWidget*> parent,
|
||||
const style::Menu &st,
|
||||
const style::MediaSlider &stSlider,
|
||||
rpl::producer<Group::ParticipantState> participantState,
|
||||
int startVolume,
|
||||
int maxVolume,
|
||||
bool muted,
|
||||
const QMargins &padding);
|
||||
|
||||
not_null<QAction*> action() const override;
|
||||
bool isEnabled() const override;
|
||||
|
||||
[[nodiscard]] rpl::producer<bool> toggleMuteRequests() const;
|
||||
[[nodiscard]] rpl::producer<bool> toggleMuteLocallyRequests() const;
|
||||
[[nodiscard]] rpl::producer<int> changeVolumeRequests() const;
|
||||
[[nodiscard]] rpl::producer<int> changeVolumeLocallyRequests() const;
|
||||
|
||||
protected:
|
||||
int contentHeight() const override;
|
||||
|
||||
private:
|
||||
void initArcsAnimation();
|
||||
|
||||
void setCloudVolume(int volume);
|
||||
void setSliderVolume(int volume);
|
||||
void updateSliderColor(float64 value);
|
||||
|
||||
QColor unmuteColor() const;
|
||||
QColor muteColor() const;
|
||||
|
||||
const int _maxVolume;
|
||||
int _cloudVolume = 0;
|
||||
bool _waitingForUpdateVolume = false;
|
||||
bool _cloudMuted = false;
|
||||
bool _localMuted = false;
|
||||
|
||||
QRect _itemRect;
|
||||
QRect _speakerRect;
|
||||
QPoint _arcPosition;
|
||||
|
||||
const base::unique_qptr<Ui::MediaSlider> _slider;
|
||||
const not_null<QAction*> _dummyAction;
|
||||
const style::Menu &_st;
|
||||
const style::CrossLineAnimation &_stCross;
|
||||
const QMargins &_padding;
|
||||
|
||||
const std::unique_ptr<Ui::CrossLineAnimation> _crossLineMute;
|
||||
Ui::Animations::Simple _crossLineAnimation;
|
||||
const std::unique_ptr<Ui::Paint::ArcsAnimation> _arcs;
|
||||
Ui::Animations::Basic _arcsAnimation;
|
||||
|
||||
rpl::event_stream<bool> _toggleMuteRequests;
|
||||
rpl::event_stream<bool> _toggleMuteLocallyRequests;
|
||||
rpl::event_stream<int> _changeVolumeRequests;
|
||||
rpl::event_stream<int> _changeVolumeLocallyRequests;
|
||||
|
||||
};
|
||||
|
||||
} // namespace Calls
|
||||
Reference in New Issue
Block a user