diff --git a/sources/ui/shapegraphicsitempropertieswidget.cpp b/sources/ui/shapegraphicsitempropertieswidget.cpp index 0383dcc25..9acef8c53 100644 --- a/sources/ui/shapegraphicsitempropertieswidget.cpp +++ b/sources/ui/shapegraphicsitempropertieswidget.cpp @@ -380,6 +380,7 @@ void ShapeGraphicsItemPropertiesWidget::updateUi() ui->m_style_cb->setCurrentIndex(static_cast(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(); + } + } +} diff --git a/sources/ui/shapegraphicsitempropertieswidget.h b/sources/ui/shapegraphicsitempropertieswidget.h index dcf9a8bd2..05ce690e4 100644 --- a/sources/ui/shapegraphicsitempropertieswidget.h +++ b/sources/ui/shapegraphicsitempropertieswidget.h @@ -63,6 +63,8 @@ class ShapeGraphicsItemPropertiesWidget : public PropertiesEditorWidget + void on_m_color_kpb_changed(const QColor &newColor); + private: Ui::ShapeGraphicsItemPropertiesWidget *ui; QetShapeItem *m_shape; diff --git a/sources/ui/shapegraphicsitempropertieswidget.ui b/sources/ui/shapegraphicsitempropertieswidget.ui index 94e52c2fa..4e97bcd0d 100644 --- a/sources/ui/shapegraphicsitempropertieswidget.ui +++ b/sources/ui/shapegraphicsitempropertieswidget.ui @@ -27,41 +27,31 @@ - - - - - Normal - - - - - Tiret - - - - - Pointillé - - - - - Traits et points - - - - - Traits points points - - - - - Tiret custom - - + + + + Type + - + + + + Couleur + + + + + + + + + + + + + + @@ -95,25 +85,38 @@ - - - - Type - - - - - - - Couleur - - - - - - - - + + + + + Normal + + + + + Tiret + + + + + Pointillé + + + + + Traits et points + + + + + Traits points points + + + + + Tiret custom + + @@ -257,6 +260,13 @@ + + + KColorButton + QPushButton +
kcolorbutton.h
+
+