Compare commits

...

49 Commits

Author SHA1 Message Date
ArgonarioD 3aebd3f2e9 merge 2023-03-20 21:07:31 +08:00
ArgonarioD b4d29f15da [stroke] fix: 对实际为空的描边的错误显示 2023-03-20 21:06:31 +08:00
ArgonarioD 9d09c73af2 merge 2023-03-20 19:53:35 +08:00
ArgonarioD 0aa69195b3 [stroke] 适配了新添加的StrokeEndType::kClosed
为封闭及非封闭图元的描边style初始化做了分化
2023-03-20 19:51:01 +08:00
ArgonarioD 21aeb0832b [stroke] 对接了Renderer方面提供的新接口 2023-03-20 19:31:16 +08:00
ArgonarioD 1ef08dc49e Merge branch 'main' into dev-LayerStyle 2023-03-20 18:54:02 +08:00
ArgonarioD cab047bff0 调整了StrokeStyle添加的GUI形式 2023-03-20 18:52:49 +08:00
ArgonarioD 43719bc81a Merge branch 'main' into dev-LayerStyle 2023-03-20 16:16:31 +08:00
ArgonarioD e7825a0665 merge 2023-03-20 02:45:22 +08:00
ArgonarioD 93db81503a 解决了一些GUI的warning
LayerStyleDialog重复setLayer导致的warning
QColorDialog::getColor时由于Qt的bug未正确设置大小导致的warning
2023-03-20 02:42:03 +08:00
ArgonarioD 412e2eec5e 添加了ColorHelper 2023-03-20 02:41:58 +08:00
ArgonarioD 64c4646783 [style] 区分封闭与不封闭图元分别做初始化 2023-03-19 14:41:24 +08:00
ArgonarioD 64e1c4a4e9 merge 2023-03-19 14:15:41 +08:00
ArgonarioD adb28a67e8 将一些可以改成引用传参的地方改成了引用 2023-03-19 01:25:31 +08:00
ArgonarioD 47ada04c3a 优化了bad smells
LayerStyleContainer::boundingBoxAffectedValue()
2023-03-19 01:20:32 +08:00
ArgonarioD 1378997f64 merge 2023-03-19 01:13:02 +08:00
ArgonarioD 1650404bb9 [fill] 实现FillElementLayerStyle 2023-03-19 01:06:51 +08:00
ArgonarioD f42868cf3f merge 2023-03-18 18:19:27 +08:00
ArgonarioD d40796abb0 为LayerStyleContainer添加了文档注释 2023-03-18 18:16:11 +08:00
ArgonarioD 73719905db 优化了一些bad smells 2023-03-18 03:49:15 +08:00
ArgonarioD 789d282393 [editor] 添加了LayerStyleContainer,重构了部分代码 2023-03-18 03:46:49 +08:00
ArgonarioD fb7caf407c [stroke] 对GUI做出了一些改善 2023-03-17 20:55:41 +08:00
ArgonarioD 096c3ac848 merge 2023-03-17 16:20:34 +08:00
ArgonarioD 7da01fbe92 [editor] 验证material组件bug已修复 2023-03-16 20:18:41 +08:00
ArgonarioD 9984dd23f8 Merge branch 'main' into dev-LayerStyle 2023-03-16 20:17:12 +08:00
ArgonarioD 200dccff46 [stroke] 完成序列化和反序列化 2023-03-16 20:16:03 +08:00
ArgonarioD fef34280c6 [editor/util] fix: toBase64 size设置有误导致编码错误 2023-03-16 20:15:13 +08:00
ArgonarioD 50a1bdaff4 merge 2023-03-16 15:47:59 +08:00
ArgonarioD ce7f2ae8fa 同上 2023-03-16 15:34:21 +08:00
ArgonarioD 6ce962b4c5 [style] 将MaterialStyle的存储方式改为了Base64编码 2023-03-16 15:34:21 +08:00
ArgonarioD f109ed7d62 merge 2023-03-16 02:05:29 +08:00
ArgonarioD 257868fd4c [style] 初步完成LayerStyle序列化 2023-03-16 01:56:05 +08:00
ArgonarioD 8809daaddd [stroke] fix: 新增描边时无法正确应用颜色修改的问题 2023-03-16 01:54:50 +08:00
ArgonarioD e72ba7ebbd [editor/util] 添加了JsonUtil 2023-03-16 01:53:28 +08:00
ArgonarioD 3ceeba61b5 [stroke] 基本完成添加单层描边功能 2023-03-15 15:39:51 +08:00
ArgonarioD 7079b335cb [style/stroke] 完成所有设置控件 2023-03-15 15:09:55 +08:00
ArgonarioD 1e3bef78f4 [style/stroke] 完成宽度设置 2023-03-15 14:23:52 +08:00
ArgonarioD 27c1d4d18a 将StrokeStyleWidget的表格改为了其中的一个类 2023-03-15 13:44:08 +08:00
ArgonarioD 460428c135 Merge branch 'main' into dev-LayerStyle 2023-03-15 11:36:32 +08:00
ArgonarioD 6494758781 Merge branch 'main' into dev-LayerStyle 2023-03-15 11:22:31 +08:00
ArgonarioD 7da434541a [stroke] 实现了行删除 2023-03-15 11:21:23 +08:00
ArgonarioD 6a742f6526 Merge branch 'main' into dev-LayerStyle 2023-03-14 23:41:49 +08:00
ArgonarioD 6191eb919e Merge branch 'main' into dev-LayerStyle 2023-03-14 22:49:29 +08:00
ArgonarioD 0ff779c5b2 基本稳定了strokeStyle的修改 2023-03-14 22:46:54 +08:00
ArgonarioD e97e6d5281 令drawElement时会应用style 2023-03-14 18:19:41 +08:00
ArgonarioD b429761d81 merged 2023-03-14 18:12:31 +08:00
ArgonarioD 1b926b2054 修改了LayerStyle
将clonePtr重命名为了clone
将StrokeElementLayerStyle的存储style方式改为了通过pair存储两侧
2023-03-14 17:59:46 +08:00
ArgonarioD 28df3d47c5 新增了ColorPicker类和StrokeStyleListView类 2023-03-14 17:57:58 +08:00
ArgonarioD 744ae58743 测试LayerStyle inputWidget的数据绑定 2023-03-12 15:39:19 +08:00
3 changed files with 5 additions and 13 deletions

View File

@ -1,6 +1,4 @@
#include "ColorPicker.h" #include "ColorPicker.h"
#include <QColorDialog>
#include <QDebug>
QString getStyleSheet(const QColor& color) QString getStyleSheet(const QColor& color)
{ {
@ -27,7 +25,6 @@ QColor ColorPicker::getColor() const
void ColorPicker::onClicked() void ColorPicker::onClicked()
{ {
//const QColor newColor = QColorDialog::getColor(this->color, this);
const QColor newColor = ColorHelper::execColorDialog(this->color, this); const QColor newColor = ColorHelper::execColorDialog(this->color, this);
if (newColor.isValid() && this->color != newColor) if (newColor.isValid() && this->color != newColor)
{ {

View File

@ -4,6 +4,7 @@
#include <qtmaterialraisedbutton.h> #include <qtmaterialraisedbutton.h>
#include <limits> #include <limits>
#include <array> #include <array>
#include <QHeaderView>
#include <ranges> #include <ranges>
#include <utility> #include <utility>
@ -28,12 +29,6 @@ StrokeStyleWidget::StrokeStyleWidget(
QWidget* parent QWidget* parent
) : QWidget(parent), stroke(stroke) ) : QWidget(parent), stroke(stroke)
{ {
auto& materialMap = radialStroke(stroke)->materialMap;
if (materialMap.empty())
{
materialMap[1.f] = newMaterial();
}
auto* viewLayout = new QVBoxLayout(this); auto* viewLayout = new QVBoxLayout(this);
this->setLayout(viewLayout); this->setLayout(viewLayout);
@ -115,7 +110,7 @@ void StrokeStyleWidget::initTable(const std::shared_ptr<Renderer::StrokeRadialGr
<< QStringLiteral("´Ö²Ú¶È") << QStringLiteral("´Ö²Ú¶È")
<< QStringLiteral("ÆäËû²Ù×÷"); << QStringLiteral("ÆäËû²Ù×÷");
strokeTable->setHorizontalHeaderLabels(headers); strokeTable->setHorizontalHeaderLabels(headers);
strokeTable->setMinimumHeight(strokeTable->rowHeight(0) * 5); strokeTable->setMinimumHeight(strokeTable->horizontalHeader()->height() * 6);
strokeTable->setMinimumWidth(strokeTable->sizeHint().width()); strokeTable->setMinimumWidth(strokeTable->sizeHint().width());
int row = 0; int row = 0;
// ÄÚÈÝ // ÄÚÈÝ
@ -131,7 +126,7 @@ void StrokeStyleWidget::initTable(const std::shared_ptr<Renderer::StrokeRadialGr
void StrokeStyleWidget::initAddButton() void StrokeStyleWidget::initAddButton()
{ {
this->addButton = new QtMaterialRaisedButton("+", strokeTable); this->addButton = new QtMaterialRaisedButton("+", strokeTable);
addButton->setFixedHeight(this->strokeTable->rowHeight(0)); addButton->setFixedHeight(30);
addButton->setBackgroundColor(ColorHelper::instance().getPrimary1()); addButton->setBackgroundColor(ColorHelper::instance().getPrimary1());
connect(addButton, &QtMaterialRaisedButton::clicked, [this] { connect(addButton, &QtMaterialRaisedButton::clicked, [this] {
handlingRowInsert = true; handlingRowInsert = true;

View File

@ -19,8 +19,8 @@ using Renderer::MaterialStyleFill;
QString getDisplayName() const override { return QStringLiteral(display_name); } \ QString getDisplayName() const override { return QStringLiteral(display_name); } \
static QString typeName() { return type_name; } \ static QString typeName() { return type_name; } \
QString getTypeName() const override { return type_name; } QString getTypeName() const override { return type_name; }
#define radialStroke(stroke) std::static_pointer_cast<Renderer::StrokeRadialGradient>(stroke->materialStroke) #define radialStroke(stroke) std::static_pointer_cast<Renderer::StrokeRadialGradient>((stroke)->materialStroke)
#define plainFill(fill) std::static_pointer_cast<Renderer::FillPlain>(fill->materialFill) #define plainFill(fill) std::static_pointer_cast<Renderer::FillPlain>((fill)->materialFill)
class LayerStyle : public Renderer::ElementStyle class LayerStyle : public Renderer::ElementStyle
{ {