From a419a0fb7aa031ca7b72e0e6a46299de9a071267 Mon Sep 17 00:00:00 2001 From: Jeremy Hu Date: Fri, 21 Sep 2018 16:14:37 +0800 Subject: [PATCH] Fix pose edit --- src/poseeditwidget.cpp | 2 +- src/poselistwidget.cpp | 2 +- src/skeletondocumentwindow.cpp | 7 +++++++ src/skeletondocumentwindow.h | 1 + 4 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/poseeditwidget.cpp b/src/poseeditwidget.cpp index 0617f3ed..d80f9e4c 100644 --- a/src/poseeditwidget.cpp +++ b/src/poseeditwidget.cpp @@ -347,9 +347,9 @@ void PoseEditWidget::save() if (m_poseId.isNull()) { emit addPose(m_nameEdit->text(), m_parameters); } else if (m_unsaved) { - m_unsaved = false; emit renamePose(m_poseId, m_nameEdit->text()); emit setPoseParameters(m_poseId, m_parameters); } + m_unsaved = false; close(); } diff --git a/src/poselistwidget.cpp b/src/poselistwidget.cpp index 39ef14b7..14cd2944 100644 --- a/src/poselistwidget.cpp +++ b/src/poselistwidget.cpp @@ -237,7 +237,7 @@ void PoseListWidget::reload() decltype(m_document->poseIdList.size()) poseIndex = 0; while (poseIndex < m_document->poseIdList.size()) { QTreeWidgetItem *item = new QTreeWidgetItem(this); - item->setFlags((item->flags() | Qt::ItemIsEditable | Qt::ItemIsEnabled) & ~(Qt::ItemIsSelectable)); + item->setFlags((item->flags() | Qt::ItemIsEnabled) & ~(Qt::ItemIsSelectable) & ~(Qt::ItemIsEditable)); for (int col = 0; col < columns && poseIndex < m_document->poseIdList.size(); col++, poseIndex++) { const auto &poseId = m_document->poseIdList[poseIndex]; item->setSizeHint(col, QSize(columnWidth, PoseWidget::preferredHeight() + 2)); diff --git a/src/skeletondocumentwindow.cpp b/src/skeletondocumentwindow.cpp index 2573ebe7..7a56ccc2 100644 --- a/src/skeletondocumentwindow.cpp +++ b/src/skeletondocumentwindow.cpp @@ -516,6 +516,13 @@ SkeletonDocumentWindow::SkeletonDocumentWindow() : }); m_windowMenu->addAction(m_showRigAction); + m_showPosesAction = new QAction(tr("Poses"), this); + connect(m_showPosesAction, &QAction::triggered, [=]() { + poseDocker->show(); + poseDocker->raise(); + }); + m_windowMenu->addAction(m_showPosesAction); + QMenu *dialogsMenu = m_windowMenu->addMenu(tr("Dialogs")); connect(dialogsMenu, &QMenu::aboutToShow, [=]() { dialogsMenu->clear(); diff --git a/src/skeletondocumentwindow.h b/src/skeletondocumentwindow.h index ce84740a..c89a977c 100644 --- a/src/skeletondocumentwindow.h +++ b/src/skeletondocumentwindow.h @@ -134,6 +134,7 @@ private: QAction *m_showPartsListAction; QAction *m_showDebugDialogAction; QAction *m_showRigAction; + QAction *m_showPosesAction; QMenu *m_helpMenu; QAction *m_viewSourceAction;