diff --git a/Telegram/SourceFiles/ui/boxes/time_picker_box.cpp b/Telegram/SourceFiles/ui/boxes/time_picker_box.cpp index 4bc79dddc..2547f919f 100644 --- a/Telegram/SourceFiles/ui/boxes/time_picker_box.cpp +++ b/Telegram/SourceFiles/ui/boxes/time_picker_box.cpp @@ -10,6 +10,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "base/event_filter.h" #include "lang/lang_keys.h" #include "ui/layers/generic_box.h" +#include "ui/effects/animation_value.h" #include "ui/ui_utility.h" #include "ui/widgets/vertical_drum_picker.h" #include "styles/style_chat.h" @@ -17,6 +18,12 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL namespace Ui { +namespace { + +constexpr auto kMinYScale = 0.2; + +} // namespace + Fn TimePickerBox( not_null box, std::vector values, @@ -53,10 +60,18 @@ Fn TimePickerBox( int outerWidth) { const auto r = QRectF(0, y, outerWidth, itemHeight); const auto progress = std::abs(distanceFromCenter); - p.setOpacity(1. - progress); + const auto revProgress = 1. - progress; + p.save(); + p.translate(r.center()); + const auto yScale = kMinYScale + + (1. - kMinYScale) * anim::easeOutCubic(1., revProgress); + p.scale(1., yScale); + p.translate(-r.center()); + p.setOpacity(revProgress); p.setFont(font); p.setPen(st::defaultFlatLabel.textFg); p.drawText(r, phrases[index], style::al_center); + p.restore(); }; const auto picker = Ui::CreateChild(