MCPcopy Create free account
hub / github.com/Audio4Linux/JDSP4Linux / SlideAnimator

Method SlideAnimator

3rdparty/WAF/Animation/Slide/SlideAnimator.cpp:28–62  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

26
27
28SlideAnimator::SlideAnimator(QWidget* _widgetForSlide) :
29 AbstractAnimator(_widgetForSlide),
30 m_direction(WAF::FromLeftToRight),
31 m_isFixBackground(true),
32 m_isFixStartSize(false),
33 m_animation(new QPropertyAnimation(_widgetForSlide, "maximumWidth")),
34 m_decorator(new SlideForegroundDecorator(_widgetForSlide))
35{
36 Q_ASSERT(_widgetForSlide);
37
38 _widgetForSlide->installEventFilter(this);
39
40 m_animation->setDuration(300);
41
42 m_decorator->hide();
43
44 //
45 // Синхронизируем изменение минимальных границ с максимальными
46 //
47 connect(m_animation, &QPropertyAnimation::valueChanged, [this] {
48 if (isWidth()) {
49 widgetForSlide()->setMinimumWidth(widgetForSlide()->maximumWidth());
50 } else {
51 widgetForSlide()->setMinimumHeight(widgetForSlide()->maximumHeight());
52 }
53 });
54
55 //
56 // Корректировки размера по завершению
57 //
58 connect(m_animation, &QPropertyAnimation::finished, [this] {
59 setAnimatedStopped();
60 m_decorator->hide();
61 });
62}
63
64void SlideAnimator::setAnimationDirection(WAF::AnimationDirection _direction)
65{

Callers

nothing calls this directly

Calls 3

connectFunction · 0.85
setDurationMethod · 0.80
hideMethod · 0.80

Tested by

no test coverage detected