Add shortcut key F

Bring the part widget of current hovered part to visible area
master
Jeremy Hu 2019-10-19 08:21:23 +09:30
parent 2b70f34d16
commit c7ba9ef1a9
4 changed files with 21 additions and 0 deletions

View File

@ -68,6 +68,8 @@ Keyboard
+----------------------+--------------------------------------------------------------------------+ +----------------------+--------------------------------------------------------------------------+
| E | Swith the Selected Nodes to Different Profile (Main / Side) | | E | Swith the Selected Nodes to Different Profile (Main / Side) |
+----------------------+--------------------------------------------------------------------------+ +----------------------+--------------------------------------------------------------------------+
| F | Bring the part widget of current hovered part to visible area |
+----------------------+--------------------------------------------------------------------------+
Mouse Mouse
====== ======

View File

@ -46,4 +46,5 @@ void initShortCuts(QWidget *widget, SkeletonGraphicsWidget *graphicsWidget)
defineKey(Qt::Key_B, &SkeletonGraphicsWidget::shortcutSubdivedOrNotSelectedPart); defineKey(Qt::Key_B, &SkeletonGraphicsWidget::shortcutSubdivedOrNotSelectedPart);
defineKey(Qt::Key_U, &SkeletonGraphicsWidget::shortcutRoundEndOrNotSelectedPart); defineKey(Qt::Key_U, &SkeletonGraphicsWidget::shortcutRoundEndOrNotSelectedPart);
defineKey(Qt::Key_W, &SkeletonGraphicsWidget::shortcutToggleWireframe); defineKey(Qt::Key_W, &SkeletonGraphicsWidget::shortcutToggleWireframe);
defineKey(Qt::Key_F, &SkeletonGraphicsWidget::shortcutCheckPartComponent);
} }

View File

@ -2386,6 +2386,23 @@ void SkeletonGraphicsWidget::selectPartAll()
} }
} }
void SkeletonGraphicsWidget::shortcutCheckPartComponent()
{
QUuid choosenPartId;
if (m_hoveredNodeItem) {
const SkeletonNode *node = m_document->findNode(m_hoveredNodeItem->id());
if (node)
choosenPartId = node->partId;
} else if (m_hoveredEdgeItem) {
const SkeletonEdge *edge = m_document->findEdge(m_hoveredEdgeItem->id());
if (edge)
choosenPartId = edge->partId;
}
if (!choosenPartId.isNull()) {
emit partComponentChecked(choosenPartId);
}
}
void SkeletonGraphicsWidget::selectAll() void SkeletonGraphicsWidget::selectAll()
{ {
unselectAll(); unselectAll();

View File

@ -543,6 +543,7 @@ public slots:
void shortcutXmirrorOnOrOffSelectedPart(); void shortcutXmirrorOnOrOffSelectedPart();
void shortcutSubdivedOrNotSelectedPart(); void shortcutSubdivedOrNotSelectedPart();
void shortcutRoundEndOrNotSelectedPart(); void shortcutRoundEndOrNotSelectedPart();
void shortcutCheckPartComponent();
private slots: private slots:
void turnaroundImageReady(); void turnaroundImageReady();
private: private: