| 61 | } |
| 62 | |
| 63 | void ElaWindowPrivate::onWMWindowClickedEvent(const QVariantMap& data) |
| 64 | { |
| 65 | ElaAppBarType::WMMouseActionType actionType = data.value("WMClickType").value<ElaAppBarType::WMMouseActionType>(); |
| 66 | if (actionType == ElaAppBarType::WMLBUTTONDBLCLK || actionType == ElaAppBarType::WMLBUTTONUP) |
| 67 | { |
| 68 | if (ElaApplication::containsCursorToItem(_navigationBar)) |
| 69 | { |
| 70 | return; |
| 71 | } |
| 72 | if (_isNavigationBarExpanded) |
| 73 | { |
| 74 | QPropertyAnimation* navigationMoveAnimation = new QPropertyAnimation(_navigationBar, "pos"); |
| 75 | connect(navigationMoveAnimation, &QPropertyAnimation::valueChanged, this, [=]() { |
| 76 | if (_isNavigationDisplayModeChanged) |
| 77 | { |
| 78 | _isNavigationBarFloat = false; |
| 79 | _resetWindowLayout(false); |
| 80 | navigationMoveAnimation->deleteLater(); |
| 81 | } |
| 82 | }); |
| 83 | connect(navigationMoveAnimation, &QPropertyAnimation::finished, this, [=]() { |
| 84 | if (!_isNavigationDisplayModeChanged) |
| 85 | { |
| 86 | _navigationBar->setDisplayMode(ElaNavigationType::Minimal, false); |
| 87 | _resetWindowLayout(false); |
| 88 | } |
| 89 | _isNavigationBarFloat = false; |
| 90 | }); |
| 91 | navigationMoveAnimation->setEasingCurve(QEasingCurve::OutCubic); |
| 92 | navigationMoveAnimation->setDuration(225); |
| 93 | navigationMoveAnimation->setStartValue(_navigationBar->pos()); |
| 94 | navigationMoveAnimation->setEndValue(QPoint(-_navigationBar->width(), 0)); |
| 95 | navigationMoveAnimation->start(QAbstractAnimation::DeleteWhenStopped); |
| 96 | _isNavigationBarExpanded = false; |
| 97 | } |
| 98 | } |
| 99 | } |
| 100 | |
| 101 | void ElaWindowPrivate::onThemeReadyChange() |
| 102 | { |
nothing calls this directly
no test coverage detected