[editor/style] fix: stroke对于空描边的错误显示
parent
0543a02dfb
commit
d55b49e119
|
@ -1,6 +1,4 @@
|
|||
#include "ColorPicker.h"
|
||||
#include <QColorDialog>
|
||||
#include <QDebug>
|
||||
|
||||
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)
|
||||
{
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
#include <qtmaterialraisedbutton.h>
|
||||
#include <limits>
|
||||
#include <array>
|
||||
#include <QHeaderView>
|
||||
#include <ranges>
|
||||
#include <utility>
|
||||
|
||||
|
@ -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_ptr<Renderer::StrokeRadialGr
|
|||
<< QStringLiteral("´Ö²Ú¶È")
|
||||
<< QStringLiteral("ÆäËû²Ù×÷");
|
||||
strokeTable->setHorizontalHeaderLabels(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_ptr<Renderer::StrokeRadialGr
|
|||
void StrokeStyleWidget::initAddButton()
|
||||
{
|
||||
this->addButton = new QtMaterialRaisedButton("+", strokeTable);
|
||||
addButton->setFixedHeight(this->strokeTable->rowHeight(0));
|
||||
addButton->setFixedHeight(30);
|
||||
addButton->setBackgroundColor(ColorHelper::instance().getPrimary1());
|
||||
connect(addButton, &QtMaterialRaisedButton::clicked, [this] {
|
||||
handlingRowInsert = true;
|
||||
|
|
|
@ -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<Renderer::StrokeRadialGradient>(stroke->materialStroke)
|
||||
#define plainFill(fill) std::static_pointer_cast<Renderer::FillPlain>(fill->materialFill)
|
||||
#define radialStroke(stroke) std::static_pointer_cast<Renderer::StrokeRadialGradient>((stroke)->materialStroke)
|
||||
#define plainFill(fill) std::static_pointer_cast<Renderer::FillPlain>((fill)->materialFill)
|
||||
|
||||
class LayerStyle : public Renderer::ElementStyle
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue