Skip to content

Commit

Permalink
Update keysview.cpp
Browse files Browse the repository at this point in the history
Add split action to right-click menu.
  • Loading branch information
rodlie committed Jul 9, 2024
1 parent 369dfec commit 033d8aa
Showing 1 changed file with 20 additions and 14 deletions.
34 changes: 20 additions & 14 deletions src/app/GUI/keysview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -331,24 +331,30 @@ void KeysView::mousePressEvent(QMouseEvent *e) {
}
}
} else {
if(mMovingKeys) {
if (mMovingKeys) {
cancelTransform();
} else {
auto movable = getRectangleMovableAtPos(
posU.x(), posU.y(),
mPixelsPerFrame,
mMinViewedFrame);
if(!movable) {
} else if(movable->isDurationRect()) {
auto movable = getRectangleMovableAtPos(posU.x(),
posU.y(),
mPixelsPerFrame,
mMinViewedFrame);
if (!movable) {
} else if (movable->isDurationRect()) {
QMenu menu;
menu.addAction(tr("Edit duration"));
// TODO: add split action
const QString editStr = tr("Edit duration");
const QString splitStr = tr("Split Clip");
menu.addAction(editStr);
menu.addAction(splitStr);
const auto selectedAction = menu.exec(e->globalPos());
if(selectedAction) {
const auto durRect = static_cast<DurationRectangle*>(movable);
if(!durRect) return;
const auto& instance = DialogsInterface::instance();
instance.showDurationSettingsDialog(durRect);
if (selectedAction) {
if (selectedAction->text() == editStr) {
const auto durRect = static_cast<DurationRectangle*>(movable);
if (!durRect) { return; }
const auto& instance = DialogsInterface::instance();
instance.showDurationSettingsDialog(durRect);
} else if (selectedAction->text() == splitStr) {
if (mCurrentScene) { mCurrentScene->splitAction(); }
}
}
}
}
Expand Down

0 comments on commit 033d8aa

Please sign in to comment.