void RowArea::mouseReleaseEvent(QMouseEvent *event) { m_viewer->setQtModifiers(0); m_viewer->stopAutoPan(); m_isPanning = false; m_viewer->dragToolRelease(event); TPoint pos(event->pos().x(), event->pos().y()); int row = m_viewer->yToRow(pos.y); if (m_playRangeActiveInMousePress && row == m_mousePressRow && (13 <= pos.x && pos.x <= 26 && (row == m_r0 || row == m_r1))) onRemoveMarkers(); }
void RowArea::contextMenuEvent(QContextMenuEvent *event) { OnionSkinMask osMask = TApp::instance()->getCurrentOnionSkin()->getOnionSkinMask(); QMenu *menu = new QMenu(this); QAction *setStartMarker = menu->addAction(tr("Set Start Marker")); connect(setStartMarker, SIGNAL(triggered()), SLOT(onSetStartMarker())); QAction *setStopMarker = menu->addAction(tr("Set Stop Marker")); connect(setStopMarker, SIGNAL(triggered()), SLOT(onSetStopMarker())); QAction *removeMarkers = menu->addAction(tr("Remove Markers")); connect(removeMarkers, SIGNAL(triggered()), SLOT(onRemoveMarkers())); //set both the from and to markers at the specified row QAction *previewThis = menu->addAction(tr("Preview This")); connect(previewThis, SIGNAL(triggered()), SLOT(onPreviewThis())); menu->addSeparator(); if (Preferences::instance()->isOnionSkinEnabled()) { OnioniSkinMaskGUI::addOnionSkinCommand(menu); menu->addSeparator(); } CommandManager *cmdManager = CommandManager::instance(); menu->addAction(cmdManager->getAction(MI_InsertSceneFrame)); menu->addAction(cmdManager->getAction(MI_RemoveSceneFrame)); menu->addAction(cmdManager->getAction(MI_InsertGlobalKeyframe)); menu->addAction(cmdManager->getAction(MI_RemoveGlobalKeyframe)); menu->addSeparator(); menu->addAction(cmdManager->getAction(MI_ShiftTrace)); menu->addAction(cmdManager->getAction(MI_EditShift)); menu->addAction(cmdManager->getAction(MI_NoShift)); menu->addAction(cmdManager->getAction(MI_ResetShift)); menu->exec(event->globalPos()); }