From 29f988aa7b84a63389080eb1bfac8da727c14193 Mon Sep 17 00:00:00 2001 From: Jeremy Hu Date: Sat, 26 Oct 2019 07:47:31 +0930 Subject: [PATCH] Add main window menu for auto colorize --- languages/dust3d_zh_CN.ts | 12 ++++++++++++ src/documentwindow.cpp | 18 ++++++++++++++++++ src/documentwindow.h | 4 ++++ 3 files changed, 34 insertions(+) diff --git a/languages/dust3d_zh_CN.ts b/languages/dust3d_zh_CN.ts index ffc1910d..9543f7e5 100644 --- a/languages/dust3d_zh_CN.ts +++ b/languages/dust3d_zh_CN.ts @@ -370,6 +370,18 @@ Tips: Toggle rotation 旋转视角 + + Colorize + 着色 + + + Blank + 空白 + + + Auto Color + 自动着色 + ExportPreviewWidget diff --git a/src/documentwindow.cpp b/src/documentwindow.cpp index 719f3992..c76f3258 100644 --- a/src/documentwindow.cpp +++ b/src/documentwindow.cpp @@ -623,6 +623,22 @@ DocumentWindow::DocumentWindow() : } 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); connect(m_selectAllAction, &QAction::triggered, m_graphicsWidget, &SkeletonGraphicsWidget::selectAll); @@ -652,6 +668,8 @@ DocumentWindow::DocumentWindow() : m_switchXzAction->setEnabled(m_graphicsWidget->hasSelection()); m_setCutFaceAction->setEnabled(m_graphicsWidget->hasSelection()); 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_alignToGlobalVerticalCenterAction->setEnabled(m_graphicsWidget->hasSelection() && m_document->originSettled()); m_alignToGlobalHorizontalCenterAction->setEnabled(m_graphicsWidget->hasSelection() && m_document->originSettled()); diff --git a/src/documentwindow.h b/src/documentwindow.h index c879a696..dd0379c6 100644 --- a/src/documentwindow.h +++ b/src/documentwindow.h @@ -153,6 +153,10 @@ private: QAction *m_markAsNoneAction; QAction *m_markAsActions[(int)BoneMark::Count - 1]; + QMenu *m_colorizeAsMenu; + QAction *m_colorizeAsBlankAction; + QAction *m_colorizeAsAutoAction; + QMenu *m_viewMenu; QAction *m_resetModelWidgetPosAction; QAction *m_toggleWireframeAction;