From b4d29f15da2fc6229fad9c31c1e30ed8fdc083bc Mon Sep 17 00:00:00 2001 From: ArgonarioD Date: Mon, 20 Mar 2023 21:06:31 +0800 Subject: [PATCH] =?UTF-8?q?[stroke]=20fix:=20=E5=AF=B9=E5=AE=9E=E9=99=85?= =?UTF-8?q?=E4=B8=BA=E7=A9=BA=E7=9A=84=E6=8F=8F=E8=BE=B9=E7=9A=84=E9=94=99?= =?UTF-8?q?=E8=AF=AF=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/Editor/EditorWidgetComponent/ColorPicker.cpp | 3 --- .../EditorWidgetComponent/StrokeStyleWidget.cpp | 11 +++-------- ArchitectureColoredPainting/src/Editor/LayerStyle.h | 4 ++-- 3 files changed, 5 insertions(+), 13 deletions(-) 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 {