diff --git a/ArchitectureColoredPainting/src/Editor/EditorWidgetComponent/ColorPicker.cpp b/ArchitectureColoredPainting/src/Editor/EditorWidgetComponent/ColorPicker.cpp index 4ccb504..a7027cf 100644 --- a/ArchitectureColoredPainting/src/Editor/EditorWidgetComponent/ColorPicker.cpp +++ b/ArchitectureColoredPainting/src/Editor/EditorWidgetComponent/ColorPicker.cpp @@ -1,6 +1,4 @@ #include "ColorPicker.h" -#include -#include QString getStyleSheet(const QColor& color) { @@ -27,7 +25,6 @@ QColor ColorPicker::getColor() const void ColorPicker::onClicked() { - //const QColor newColor = QColorDialog::getColor(this->color, this); const QColor newColor = ColorHelper::execColorDialog(this->color, this); if (newColor.isValid() && this->color != newColor) { diff --git a/ArchitectureColoredPainting/src/Editor/EditorWidgetComponent/StrokeStyleWidget.cpp b/ArchitectureColoredPainting/src/Editor/EditorWidgetComponent/StrokeStyleWidget.cpp index 7422763..a8699f9 100644 --- a/ArchitectureColoredPainting/src/Editor/EditorWidgetComponent/StrokeStyleWidget.cpp +++ b/ArchitectureColoredPainting/src/Editor/EditorWidgetComponent/StrokeStyleWidget.cpp @@ -4,6 +4,7 @@ #include #include #include +#include #include #include @@ -28,12 +29,6 @@ StrokeStyleWidget::StrokeStyleWidget( QWidget* parent ) : QWidget(parent), stroke(stroke) { - auto& materialMap = radialStroke(stroke)->materialMap; - if (materialMap.empty()) - { - materialMap[1.f] = newMaterial(); - } - auto* viewLayout = new QVBoxLayout(this); this->setLayout(viewLayout); @@ -115,7 +110,7 @@ void StrokeStyleWidget::initTable(const std::shared_ptrsetHorizontalHeaderLabels(headers); - strokeTable->setMinimumHeight(strokeTable->rowHeight(0) * 5); + strokeTable->setMinimumHeight(strokeTable->horizontalHeader()->height() * 6); strokeTable->setMinimumWidth(strokeTable->sizeHint().width()); int row = 0; // 内容 @@ -131,7 +126,7 @@ void StrokeStyleWidget::initTable(const std::shared_ptraddButton = new QtMaterialRaisedButton("+", strokeTable); - addButton->setFixedHeight(this->strokeTable->rowHeight(0)); + addButton->setFixedHeight(30); addButton->setBackgroundColor(ColorHelper::instance().getPrimary1()); connect(addButton, &QtMaterialRaisedButton::clicked, [this] { handlingRowInsert = true; diff --git a/ArchitectureColoredPainting/src/Editor/LayerStyle.h b/ArchitectureColoredPainting/src/Editor/LayerStyle.h index 3eba1ad..45888a1 100644 --- a/ArchitectureColoredPainting/src/Editor/LayerStyle.h +++ b/ArchitectureColoredPainting/src/Editor/LayerStyle.h @@ -19,8 +19,8 @@ using Renderer::MaterialStyleFill; QString getDisplayName() const override { return QStringLiteral(display_name); } \ static QString typeName() { return type_name; } \ QString getTypeName() const override { return type_name; } -#define radialStroke(stroke) std::static_pointer_cast(stroke->materialStroke) -#define plainFill(fill) std::static_pointer_cast(fill->materialFill) +#define radialStroke(stroke) std::static_pointer_cast((stroke)->materialStroke) +#define plainFill(fill) std::static_pointer_cast((fill)->materialFill) class LayerStyle : public Renderer::ElementStyle {