Fix pose edit

master
Jeremy Hu 2018-09-21 16:14:37 +08:00
parent e22a6de6cb
commit a419a0fb7a
4 changed files with 10 additions and 2 deletions

View File

@ -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();
}

View File

@ -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));

View File

@ -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();

View File

@ -134,6 +134,7 @@ private:
QAction *m_showPartsListAction;
QAction *m_showDebugDialogAction;
QAction *m_showRigAction;
QAction *m_showPosesAction;
QMenu *m_helpMenu;
QAction *m_viewSourceAction;