|
48 | 48 | #include "BlendEffects/blendeffectcollection.h" |
49 | 49 | #include "BlendEffects/blendeffectboxshadow.h" |
50 | 50 | #include "Sound/eindependentsound.h" |
51 | | - |
| 51 | +#include "GUI/propertynamedialog.h" |
52 | 52 | #include "Animators/SmartPath/smartpathcollection.h" |
53 | 53 |
|
54 | 54 | #include "typemenu.h" |
@@ -707,19 +707,29 @@ void BoxSingleWidget::mouseMoveEvent(QMouseEvent *event) { |
707 | 707 | drag->exec(Qt::CopyAction | Qt::MoveAction); |
708 | 708 | } |
709 | 709 |
|
710 | | -void BoxSingleWidget::mouseReleaseEvent(QMouseEvent *event) { |
711 | | - if(!mTarget) return; |
712 | | - if(event->x() < mFillWidget->x() || |
713 | | - event->x() > mFillWidget->x() + mFillWidget->width()) return; |
| 710 | +void BoxSingleWidget::mouseReleaseEvent(QMouseEvent *event) |
| 711 | +{ |
| 712 | + if (!mTarget) { return; } |
| 713 | + const auto target = mTarget->getTarget(); |
| 714 | + |
| 715 | + const auto bbox = enve_cast<BoundingBox*>(target); |
| 716 | + if (event->button() == Qt::MidButton && bbox) { |
| 717 | + PropertyNameDialog::sRenameBox(bbox, this); |
| 718 | + return; |
| 719 | + } |
| 720 | + |
| 721 | + if (event->x() < mFillWidget->x() || |
| 722 | + event->x() > mFillWidget->x() + mFillWidget->width()) { return; } |
714 | 723 | setSelected(false); |
715 | | - if(pointToLen(event->pos() - mDragStartPos) > eSizesUI::widget/2) return; |
| 724 | + |
| 725 | + if (pointToLen(event->pos() - mDragStartPos) > eSizesUI::widget/2) { return; } |
| 726 | + |
716 | 727 | const bool shiftPressed = event->modifiers() & Qt::ShiftModifier; |
717 | | - const auto target = mTarget->getTarget(); |
718 | | - if(enve_cast<BoundingBox*>(target) || enve_cast<eIndependentSound*>(target)) { |
| 728 | + if (enve_cast<BoundingBox*>(target) || enve_cast<eIndependentSound*>(target)) { |
719 | 729 | const auto boxTarget = static_cast<eBoxOrSound*>(target); |
720 | 730 | boxTarget->selectionChangeTriggered(shiftPressed); |
721 | 731 | Document::sInstance->actionFinished(); |
722 | | - } else if(const auto pTarget = enve_cast<Property*>(target)) { |
| 732 | + } else if (const auto pTarget = enve_cast<Property*>(target)) { |
723 | 733 | pTarget->prp_selectionChangeTriggered(shiftPressed); |
724 | 734 | } |
725 | 735 | } |
|
0 commit comments