Add KColorButton in the shape properties editor

git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@5757 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
blacksun
2019-03-04 15:42:53 +00:00
parent aaba90419f
commit 504636cb79
3 changed files with 77 additions and 52 deletions

View File

@@ -380,6 +380,7 @@ void ShapeGraphicsItemPropertiesWidget::updateUi()
ui->m_style_cb->setCurrentIndex(static_cast<int>(m_shape->pen().style()) - 1);
ui->m_size_dsb ->setValue(m_shape->pen().widthF());
setPenColorButton(m_shape->pen().color());
ui->m_color_kpb->setColor(m_shape->pen().color());
//Brush
if (m_shape->shapeType() == QetShapeItem::Polygon)
@@ -424,6 +425,7 @@ void ShapeGraphicsItemPropertiesWidget::updateUi()
}
}
setPenColorButton(same ? pc : QColor());
ui->m_color_kpb->setColor(same ? pc : QColor());
//Brush
ui->m_filling_gb->setVisible(true);
@@ -584,3 +586,14 @@ void ShapeGraphicsItemPropertiesWidget::on_m_brush_color_pb_clicked()
}
void ShapeGraphicsItemPropertiesWidget::on_m_color_kpb_changed(const QColor &newColor)
{
if (newColor.isValid())
{
setPenColorButton(newColor);
if (m_live_edit) {
apply();
}
}
}