diff --git a/ui/colors.palette b/ui/colors.palette index 6d1083c..4fd9208 100644 --- a/ui/colors.palette +++ b/ui/colors.palette @@ -571,8 +571,12 @@ groupCallLive1: #0dcc39; // group call live button color1 groupCallLive2: #0bb6bd; // group call live button color2 groupCallMuted1: #0992ef; // group call muted button color1 groupCallMuted2: #16ccfb; // group call muted button color2 -groupCallForceMuted1: #d4527c; // group call force muted button color1 -groupCallForceMuted2: #5d8efa; // group call force muted button color2 +groupCallForceMutedBar1: #c65493; // group call force muted top bar color1 +groupCallForceMutedBar2: #7a6af1; // group call force muted top bar color2 +groupCallForceMutedBar3: #5f95e8; // group call force muted top bar color3 +groupCallForceMuted1: #4f9cff; // group call force muted button color1 +groupCallForceMuted2: #9b52e9; // group call force muted button color2 +groupCallForceMuted3: #eb5353; // group call force muted button color3 groupCallMenuBg: #292d33; // group call popup menu background groupCallMenuBgOver: #343940; // group call popup menu with mouse over groupCallMenuBgRipple: #3a4047; // group call popup menu ripple effect diff --git a/ui/widgets/call_mute_button.cpp b/ui/widgets/call_mute_button.cpp index ae21a66..e959e90 100644 --- a/ui/widgets/call_mute_button.cpp +++ b/ui/widgets/call_mute_button.cpp @@ -8,7 +8,6 @@ #include "base/flat_map.h" #include "ui/abstract_button.h" -#include "ui/effects/gradient.h" #include "ui/effects/radial_animation.h" #include "ui/paint/blobs.h" #include "ui/painter.h" @@ -80,22 +79,26 @@ auto MuteBlobs() { auto Colors() { using Vector = std::vector; - return base::flat_map{ + using Colors = anim::gradient_colors; + return base::flat_map{ { CallMuteButtonType::ForceMuted, - Vector{ st::groupCallForceMuted1->c, st::groupCallForceMuted2->c } + Colors(QGradientStops{ + { .0, st::groupCallForceMuted1->c }, + { .5, st::groupCallForceMuted2->c }, + { 1., st::groupCallForceMuted3->c } }) }, { CallMuteButtonType::Active, - Vector{ st::groupCallLive1->c, st::groupCallLive2->c } + Colors(Vector{ st::groupCallLive1->c, st::groupCallLive2->c }) }, { CallMuteButtonType::Connecting, - Vector{ st::callIconBg->c, st::callIconBg->c } + Colors(st::callIconBg->c) }, { CallMuteButtonType::Muted, - Vector{ st::groupCallMuted1->c, st::groupCallMuted2->c } + Colors(Vector{ st::groupCallMuted1->c, st::groupCallMuted2->c }) }, }; } @@ -343,7 +346,8 @@ void CallMuteButton::init() { const auto blobsInner = [&] { // The point of the circle at 45 degrees. - const auto mF = std::sqrt(_blobs->innerRect().width()) / 2.; + const auto w = _blobs->innerRect().width(); + const auto mF = (1 - std::cos(M_PI / 4.)) * (w / 2.); return _blobs->innerRect().marginsRemoved(QMarginsF(mF, mF, mF, mF)); }(); @@ -354,13 +358,15 @@ void CallMuteButton::init() { auto glowColors = [&] { auto copy = _colors; - for (auto &[type, colors] : copy) { - if (IsInactive(type)) { - colors[0] = st::groupCallBg->c; - } else { - colors[0].setAlpha(kGlowAlpha); - } - colors[1] = QColor(Qt::transparent); + for (auto &[type, stops] : copy) { + auto firstColor = IsInactive(type) + ? st::groupCallBg->c + : stops.stops[0].second; + firstColor.setAlpha(kGlowAlpha); + stops.stops = QGradientStops{ + { 0., std::move(firstColor) }, + { 1., QColor(Qt::transparent) } + }; } return copy; }(); @@ -595,8 +601,8 @@ void CallMuteButton::overridesColors( _colorOverrides.fire({ std::nullopt, std::nullopt }); return; } - auto from = _colors.find(fromType)->second[0]; - auto to = _colors.find(toType)->second[0]; + auto from = _colors.find(fromType)->second.stops[0].second; + auto to = _colors.find(toType)->second.stops[0].second; auto fromRipple = from; auto toRipple = to; if (!toInactive) { diff --git a/ui/widgets/call_mute_button.h b/ui/widgets/call_mute_button.h index 58d3116..cc55df4 100644 --- a/ui/widgets/call_mute_button.h +++ b/ui/widgets/call_mute_button.h @@ -9,6 +9,7 @@ #include "base/unique_qptr.h" #include "ui/effects/animations.h" #include "ui/effects/cross_line.h" +#include "ui/effects/gradient.h" namespace Ui { @@ -99,7 +100,7 @@ private: int _labelShakeShift = 0; std::unique_ptr _radial; - const base::flat_map> _colors; + const base::flat_map _colors; CrossLineAnimation _crossLineMuteAnimation; Animations::Simple _switchAnimation;