From e6571faf8c69738a55241bb4da6499d87e6d1b2c Mon Sep 17 00:00:00 2001 From: karlis <2995621482@qq.com> Date: Mon, 20 Mar 2023 20:16:15 +0800 Subject: [PATCH] FIX | #20 --- .../src/Editor/EditorWidgetComponent/LayerCreateWidget.cpp | 2 ++ .../src/Editor/RightBar/LayerTreeWidget.cpp | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/ArchitectureColoredPainting/src/Editor/EditorWidgetComponent/LayerCreateWidget.cpp b/ArchitectureColoredPainting/src/Editor/EditorWidgetComponent/LayerCreateWidget.cpp index 45d8dfe..511dcfc 100644 --- a/ArchitectureColoredPainting/src/Editor/EditorWidgetComponent/LayerCreateWidget.cpp +++ b/ArchitectureColoredPainting/src/Editor/EditorWidgetComponent/LayerCreateWidget.cpp @@ -6,6 +6,8 @@ LayerCreateWidget::LayerCreateWidget(ElementManager* elementManager, FolderLayer { this->elementManager = elementManager; ui.setupUi(this); + ui.name->setPlaceholderText(QString::fromLocal8Bit("")); + ui.name->setText(QString::fromLocal8Bit("子图层-") + QString::number(folderLayer->children.size() + 1)); connect(ui.buttonBox, SIGNAL(accepted()), this, SLOT(accept())); connect(ui.buttonBox, SIGNAL(rejected()), this, SLOT(reject())); connect(ui.comboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(onCurrentIndexChanged(int))); diff --git a/ArchitectureColoredPainting/src/Editor/RightBar/LayerTreeWidget.cpp b/ArchitectureColoredPainting/src/Editor/RightBar/LayerTreeWidget.cpp index 5090342..0c5857b 100644 --- a/ArchitectureColoredPainting/src/Editor/RightBar/LayerTreeWidget.cpp +++ b/ArchitectureColoredPainting/src/Editor/RightBar/LayerTreeWidget.cpp @@ -93,13 +93,13 @@ void LayerTreeWidget::popMenu(const QPoint &pos) } } if (typeid(*layer) == typeid(FolderLayerWrapper) && ((FolderLayerWrapper*)layer)->getReferencedBy() == -1) { - menu.addAction(QString::fromLocal8Bit("创建组合元素"), this, [this]() { + menu.addAction(QString::fromLocal8Bit("创建组合元素"), this, [this, layer]() { auto layer = dynamic_cast(this->selectedItem->data(0, Qt::UserRole).value()); if (layer != nullptr) { bool ok; QString name = QInputDialog::getText(this, QString::fromLocal8Bit("创建组合元素"), QString::fromLocal8Bit("组合元素名称:"), QLineEdit::Normal, - "", &ok); + QString::fromLocal8Bit("图源") + layer->property.name, &ok); if (ok && !name.isEmpty()) { elementManager->createGroupElement(name, layer); emit triggerCentralRefresh();