Implemented coarse color picker
This commit is contained in:
1 parent
b6a6084ba8
commit
42108b2c65
16 files changed
+291
-97
No files matched your search
@@ -94,7 +94,7 @@ void EditSpriteDialog::newSprite()
|
||||
m_model->beginResetModel();
|
||||
m_pixmaps = std::vector<QPixmap> { std::move(pixmap) };
|
||||
m_model->endResetModel();
|
||||
qDebug() << m_model->rowCount({});
|
||||
|
||||
changed();
|
||||
}
|
||||
}
|
||||
@@ -110,11 +110,9 @@ void EditSpriteDialog::doubleClicked(const QModelIndex &index)
|
||||
ImageEditorDialog dialog{m_model->pixmap(index), tr("Image Editor: %0").arg(m_spriteName), this};
|
||||
if (dialog.exec() == QDialog::Accepted)
|
||||
{
|
||||
qDebug() << "apply pixmap?!";
|
||||
emit m_model->beginResetModel();
|
||||
m_pixmaps[index.row()] = dialog.pixmap();
|
||||
emit m_model->endResetModel();
|
||||
//emit m_model->dataChanged(index, index, {Qt::DecorationRole});
|
||||
emit m_model->dataChanged(index, index, {Qt::DecorationRole});
|
||||
|
||||
changed();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,6 +34,16 @@ ImageEditorDialog::ImageEditorDialog(const QPixmap &pixmap, const QString &title
|
||||
connect(m_ui->pushButtonRightButtonColor, &QAbstractButton::pressed,
|
||||
this, &ImageEditorDialog::selectRightButtonColor);
|
||||
|
||||
connect(m_ui->frameColorCoarse, &ColorWidget::colorLeftClicked,
|
||||
m_ui->canvas, &DrawingCanvasWidget::setLeftButtonColor);
|
||||
connect(m_ui->frameColorCoarse, &ColorWidget::colorRightClicked,
|
||||
m_ui->canvas, &DrawingCanvasWidget::setRightButtonColor);
|
||||
|
||||
connect(m_ui->frameColorFine, &ColorWidget::colorLeftClicked,
|
||||
m_ui->canvas, &DrawingCanvasWidget::setLeftButtonColor);
|
||||
connect(m_ui->frameColorFine, &ColorWidget::colorRightClicked,
|
||||
m_ui->canvas, &DrawingCanvasWidget::setRightButtonColor);
|
||||
|
||||
connect(m_ui->canvas, &DrawingCanvasWidget::changed,
|
||||
this, &ImageEditorDialog::changed);
|
||||
connect(m_ui->canvas, &DrawingCanvasWidget::leftButtonColorChanged,
|
||||
|
||||
@@ -725,12 +725,20 @@
|
||||
<string>Colors</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||
<property name="spacing">
|
||||
<number>10</number>
|
||||
</property>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2" stretch="0,0">
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_4">
|
||||
<item>
|
||||
<widget class="QLabel" name="labelLeft">
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>8</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Left</string>
|
||||
</property>
|
||||
@@ -752,6 +760,11 @@
|
||||
<layout class="QVBoxLayout" name="verticalLayout_5">
|
||||
<item>
|
||||
<widget class="QLabel" name="labelRight">
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>8</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Right</string>
|
||||
</property>
|
||||
@@ -772,34 +785,34 @@
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="ColorWidget" name="frameColorCoarse">
|
||||
<widget class="CoarseColorWidget" name="frameColorCoarse">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>75</width>
|
||||
<height>100</height>
|
||||
<width>0</width>
|
||||
<height>125</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::Shape::StyledPanel</enum>
|
||||
<enum>QFrame::Shape::Panel</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Shadow::Raised</enum>
|
||||
<enum>QFrame::Shadow::Sunken</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="ColorWidget" name="frameColorFine">
|
||||
<widget class="FineColorWidget" name="frameColorFine">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>75</width>
|
||||
<height>100</height>
|
||||
<width>0</width>
|
||||
<height>125</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::Shape::StyledPanel</enum>
|
||||
<enum>QFrame::Shape::Panel</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Shadow::Raised</enum>
|
||||
<enum>QFrame::Shadow::Sunken</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@@ -1112,9 +1125,15 @@
|
||||
<header>widgets/drawingcanvaswidget.h</header>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>ColorWidget</class>
|
||||
<class>CoarseColorWidget</class>
|
||||
<extends>QFrame</extends>
|
||||
<header>widgets/colorwidget.h</header>
|
||||
<header>widgets/coarsecolorwidget.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>FineColorWidget</class>
|
||||
<extends>QFrame</extends>
|
||||
<header>widgets/finecolorwidget.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
|
||||
Reference in new issue
Block a user