mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-07 23:53:58 +02:00
Reduced size of volume speaker in list of participants in group calls.
This commit is contained in:
parent
bf61f624c5
commit
85b3672bc8
5 changed files with 21 additions and 9 deletions
BIN
Telegram/Resources/icons/calls/volume/speaker_small.png
Normal file
BIN
Telegram/Resources/icons/calls/volume/speaker_small.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 310 B |
BIN
Telegram/Resources/icons/calls/volume/speaker_small@2x.png
Normal file
BIN
Telegram/Resources/icons/calls/volume/speaker_small@2x.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 521 B |
BIN
Telegram/Resources/icons/calls/volume/speaker_small@3x.png
Normal file
BIN
Telegram/Resources/icons/calls/volume/speaker_small@3x.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 734 B |
|
@ -809,6 +809,16 @@ groupCallSpeakerArcsAnimation: ArcsAnimation {
|
||||||
startWidth: 0px;
|
startWidth: 0px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
groupCallStatusSpeakerIcon: icon {{ "calls/volume/speaker_small", groupCallIconFg }};
|
||||||
|
groupCallStatusSpeakerArcsSkip: 3px;
|
||||||
|
groupCallStatusSpeakerArcsAnimation: ArcsAnimation(groupCallSpeakerArcsAnimation) {
|
||||||
|
deltaAngle: 68;
|
||||||
|
space: 3px;
|
||||||
|
deltaHeight: 5px;
|
||||||
|
deltaWidth: 4px;
|
||||||
|
startHeight: 1px;
|
||||||
|
}
|
||||||
|
|
||||||
callTopBarMuteCrossLine: CrossLineAnimation {
|
callTopBarMuteCrossLine: CrossLineAnimation {
|
||||||
fg: callBarFg;
|
fg: callBarFg;
|
||||||
icon: icon {{ "calls/call_record_active", callBarFg }};
|
icon: icon {{ "calls/call_record_active", callBarFg }};
|
||||||
|
|
|
@ -49,8 +49,9 @@ constexpr auto kWideScale = 5;
|
||||||
|
|
||||||
constexpr auto kSpeakerThreshold = {
|
constexpr auto kSpeakerThreshold = {
|
||||||
Group::kDefaultVolume * 0.1f / Group::kMaxVolume,
|
Group::kDefaultVolume * 0.1f / Group::kMaxVolume,
|
||||||
Group::kDefaultVolume * 0.5f / Group::kMaxVolume,
|
Group::kDefaultVolume * 0.9f / Group::kMaxVolume };
|
||||||
Group::kDefaultVolume * 1.5f / Group::kMaxVolume };
|
|
||||||
|
constexpr auto kArcsStrokeRatio = 0.8;
|
||||||
|
|
||||||
auto RowBlobs() -> std::array<Ui::Paint::Blobs::BlobData, 2> {
|
auto RowBlobs() -> std::array<Ui::Paint::Blobs::BlobData, 2> {
|
||||||
return { {
|
return { {
|
||||||
|
@ -188,9 +189,9 @@ private:
|
||||||
|
|
||||||
struct StatusIcon {
|
struct StatusIcon {
|
||||||
StatusIcon(float volume)
|
StatusIcon(float volume)
|
||||||
: speaker(st::groupCallMuteCrossLine.icon)
|
: speaker(st::groupCallStatusSpeakerIcon)
|
||||||
, arcs(std::make_unique<Ui::Paint::ArcsAnimation>(
|
, arcs(std::make_unique<Ui::Paint::ArcsAnimation>(
|
||||||
st::groupCallSpeakerArcsAnimation,
|
st::groupCallStatusSpeakerArcsAnimation,
|
||||||
kSpeakerThreshold,
|
kSpeakerThreshold,
|
||||||
volume,
|
volume,
|
||||||
Ui::Paint::ArcsAnimation::HorizontalDirection::Right)) {
|
Ui::Paint::ArcsAnimation::HorizontalDirection::Right)) {
|
||||||
|
@ -398,6 +399,7 @@ void Row::setSpeaking(bool speaking) {
|
||||||
} else if (!_statusIcon) {
|
} else if (!_statusIcon) {
|
||||||
_statusIcon = std::make_unique<StatusIcon>(
|
_statusIcon = std::make_unique<StatusIcon>(
|
||||||
(float)_volume / Group::kMaxVolume);
|
(float)_volume / Group::kMaxVolume);
|
||||||
|
_statusIcon->arcs->setStrokeRatio(kArcsStrokeRatio);
|
||||||
_statusIcon->arcsWidth = _statusIcon->arcs->finishedWidth();
|
_statusIcon->arcsWidth = _statusIcon->arcs->finishedWidth();
|
||||||
|
|
||||||
const auto wasArcsWidth = _statusIcon->lifetime.make_state<int>(0);
|
const auto wasArcsWidth = _statusIcon->lifetime.make_state<int>(0);
|
||||||
|
@ -599,9 +601,7 @@ int Row::statusIconWidth() const {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
return _speaking
|
return _speaking
|
||||||
? (_statusIcon->speaker.width() / 2
|
? (_statusIcon->speaker.width() + _statusIcon->arcsWidth)
|
||||||
+ _statusIcon->arcsWidth
|
|
||||||
+ st::groupCallMenuVolumeSkip)
|
|
||||||
: 0;
|
: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -632,8 +632,10 @@ void Row::paintStatusIcon(
|
||||||
st.statusPosition
|
st.statusPosition
|
||||||
+ QPoint(0, (font->height - statusIconHeight()) / 2),
|
+ QPoint(0, (font->height - statusIconHeight()) / 2),
|
||||||
_statusIcon->speaker.size());
|
_statusIcon->speaker.size());
|
||||||
const auto arcPosition = speakerRect.center()
|
const auto arcPosition = speakerRect.topLeft()
|
||||||
+ QPoint(0, st::groupCallMenuSpeakerArcsSkip);
|
+ QPoint(
|
||||||
|
speakerRect.width() - st::groupCallStatusSpeakerArcsSkip,
|
||||||
|
speakerRect.height() / 2);
|
||||||
|
|
||||||
const auto volume = std::round(_volume / 100.);
|
const auto volume = std::round(_volume / 100.);
|
||||||
_statusIcon->speaker.paint(
|
_statusIcon->speaker.paint(
|
||||||
|
|
Loading…
Add table
Reference in a new issue