Add main window menu for auto colorize

master
Jeremy Hu 2019-10-26 07:47:31 +09:30
parent db9d8c04c0
commit 29f988aa7b
3 changed files with 34 additions and 0 deletions

View File

@ -370,6 +370,18 @@ Tips:
<source>Toggle rotation</source> <source>Toggle rotation</source>
<translation></translation> <translation></translation>
</message> </message>
<message>
<source>Colorize</source>
<translation></translation>
</message>
<message>
<source>Blank</source>
<translation></translation>
</message>
<message>
<source>Auto Color</source>
<translation></translation>
</message>
</context> </context>
<context> <context>
<name>ExportPreviewWidget</name> <name>ExportPreviewWidget</name>

View File

@ -624,6 +624,22 @@ DocumentWindow::DocumentWindow() :
m_editMenu->addMenu(m_markAsMenu); m_editMenu->addMenu(m_markAsMenu);
m_colorizeAsMenu = new QMenu(tr("Colorize"));
m_colorizeAsBlankAction = new QAction(tr("Blank"), this);
connect(m_colorizeAsBlankAction, &QAction::triggered, [=]() {
m_graphicsWidget->fadeSelected();
});
m_colorizeAsMenu->addAction(m_colorizeAsBlankAction);
m_colorizeAsAutoAction = new QAction(tr("Auto Color"), this);
connect(m_colorizeAsAutoAction, &QAction::triggered, [=]() {
m_graphicsWidget->colorizeSelected();
});
m_colorizeAsMenu->addAction(m_colorizeAsAutoAction);
m_editMenu->addMenu(m_colorizeAsMenu);
m_selectAllAction = new QAction(tr("Select All"), this); m_selectAllAction = new QAction(tr("Select All"), this);
connect(m_selectAllAction, &QAction::triggered, m_graphicsWidget, &SkeletonGraphicsWidget::selectAll); connect(m_selectAllAction, &QAction::triggered, m_graphicsWidget, &SkeletonGraphicsWidget::selectAll);
m_editMenu->addAction(m_selectAllAction); m_editMenu->addAction(m_selectAllAction);
@ -652,6 +668,8 @@ DocumentWindow::DocumentWindow() :
m_switchXzAction->setEnabled(m_graphicsWidget->hasSelection()); m_switchXzAction->setEnabled(m_graphicsWidget->hasSelection());
m_setCutFaceAction->setEnabled(m_graphicsWidget->hasSelection()); m_setCutFaceAction->setEnabled(m_graphicsWidget->hasSelection());
m_clearCutFaceAction->setEnabled(m_graphicsWidget->hasCutFaceAdjustedNodesSelection()); m_clearCutFaceAction->setEnabled(m_graphicsWidget->hasCutFaceAdjustedNodesSelection());
m_colorizeAsBlankAction->setEnabled(m_graphicsWidget->hasSelection());
m_colorizeAsAutoAction->setEnabled(m_graphicsWidget->hasSelection());
m_alignToGlobalCenterAction->setEnabled(m_graphicsWidget->hasSelection() && m_document->originSettled()); m_alignToGlobalCenterAction->setEnabled(m_graphicsWidget->hasSelection() && m_document->originSettled());
m_alignToGlobalVerticalCenterAction->setEnabled(m_graphicsWidget->hasSelection() && m_document->originSettled()); m_alignToGlobalVerticalCenterAction->setEnabled(m_graphicsWidget->hasSelection() && m_document->originSettled());
m_alignToGlobalHorizontalCenterAction->setEnabled(m_graphicsWidget->hasSelection() && m_document->originSettled()); m_alignToGlobalHorizontalCenterAction->setEnabled(m_graphicsWidget->hasSelection() && m_document->originSettled());

View File

@ -153,6 +153,10 @@ private:
QAction *m_markAsNoneAction; QAction *m_markAsNoneAction;
QAction *m_markAsActions[(int)BoneMark::Count - 1]; QAction *m_markAsActions[(int)BoneMark::Count - 1];
QMenu *m_colorizeAsMenu;
QAction *m_colorizeAsBlankAction;
QAction *m_colorizeAsAutoAction;
QMenu *m_viewMenu; QMenu *m_viewMenu;
QAction *m_resetModelWidgetPosAction; QAction *m_resetModelWidgetPosAction;
QAction *m_toggleWireframeAction; QAction *m_toggleWireframeAction;