mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-17 12:40:35 +01:00
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:
@@ -380,6 +380,7 @@ void ShapeGraphicsItemPropertiesWidget::updateUi()
|
|||||||
ui->m_style_cb->setCurrentIndex(static_cast<int>(m_shape->pen().style()) - 1);
|
ui->m_style_cb->setCurrentIndex(static_cast<int>(m_shape->pen().style()) - 1);
|
||||||
ui->m_size_dsb ->setValue(m_shape->pen().widthF());
|
ui->m_size_dsb ->setValue(m_shape->pen().widthF());
|
||||||
setPenColorButton(m_shape->pen().color());
|
setPenColorButton(m_shape->pen().color());
|
||||||
|
ui->m_color_kpb->setColor(m_shape->pen().color());
|
||||||
|
|
||||||
//Brush
|
//Brush
|
||||||
if (m_shape->shapeType() == QetShapeItem::Polygon)
|
if (m_shape->shapeType() == QetShapeItem::Polygon)
|
||||||
@@ -424,6 +425,7 @@ void ShapeGraphicsItemPropertiesWidget::updateUi()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
setPenColorButton(same ? pc : QColor());
|
setPenColorButton(same ? pc : QColor());
|
||||||
|
ui->m_color_kpb->setColor(same ? pc : QColor());
|
||||||
|
|
||||||
//Brush
|
//Brush
|
||||||
ui->m_filling_gb->setVisible(true);
|
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();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -63,6 +63,8 @@ class ShapeGraphicsItemPropertiesWidget : public PropertiesEditorWidget
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void on_m_color_kpb_changed(const QColor &newColor);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::ShapeGraphicsItemPropertiesWidget *ui;
|
Ui::ShapeGraphicsItemPropertiesWidget *ui;
|
||||||
QetShapeItem *m_shape;
|
QetShapeItem *m_shape;
|
||||||
|
|||||||
@@ -27,41 +27,31 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="0" column="1">
|
<item row="0" column="0">
|
||||||
<widget class="QComboBox" name="m_style_cb">
|
<widget class="QLabel" name="label">
|
||||||
<item>
|
<property name="text">
|
||||||
<property name="text">
|
<string>Type</string>
|
||||||
<string>Normal</string>
|
</property>
|
||||||
</property>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<property name="text">
|
|
||||||
<string>Tiret</string>
|
|
||||||
</property>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<property name="text">
|
|
||||||
<string>Pointillé</string>
|
|
||||||
</property>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<property name="text">
|
|
||||||
<string>Traits et points</string>
|
|
||||||
</property>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<property name="text">
|
|
||||||
<string>Traits points points</string>
|
|
||||||
</property>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<property name="text">
|
|
||||||
<string>Tiret custom</string>
|
|
||||||
</property>
|
|
||||||
</item>
|
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="1">
|
<item row="2" column="0">
|
||||||
|
<widget class="QLabel" name="label_3">
|
||||||
|
<property name="text">
|
||||||
|
<string>Couleur</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="1">
|
||||||
|
<widget class="QPushButton" name="m_color_pb">
|
||||||
|
<property name="text">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="2">
|
||||||
|
<widget class="KColorButton" name="m_color_kpb"/>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="1" colspan="2">
|
||||||
<widget class="QDoubleSpinBox" name="m_size_dsb">
|
<widget class="QDoubleSpinBox" name="m_size_dsb">
|
||||||
<property name="maximumSize">
|
<property name="maximumSize">
|
||||||
<size>
|
<size>
|
||||||
@@ -95,25 +85,38 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="0" column="0">
|
<item row="0" column="1" colspan="2">
|
||||||
<widget class="QLabel" name="label">
|
<widget class="QComboBox" name="m_style_cb">
|
||||||
<property name="text">
|
<item>
|
||||||
<string>Type</string>
|
<property name="text">
|
||||||
</property>
|
<string>Normal</string>
|
||||||
</widget>
|
</property>
|
||||||
</item>
|
</item>
|
||||||
<item row="2" column="0">
|
<item>
|
||||||
<widget class="QLabel" name="label_3">
|
<property name="text">
|
||||||
<property name="text">
|
<string>Tiret</string>
|
||||||
<string>Couleur</string>
|
</property>
|
||||||
</property>
|
</item>
|
||||||
</widget>
|
<item>
|
||||||
</item>
|
<property name="text">
|
||||||
<item row="2" column="1">
|
<string>Pointillé</string>
|
||||||
<widget class="QPushButton" name="m_color_pb">
|
</property>
|
||||||
<property name="text">
|
</item>
|
||||||
<string/>
|
<item>
|
||||||
</property>
|
<property name="text">
|
||||||
|
<string>Traits et points</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>Traits points points</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>Tiret custom</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
@@ -257,6 +260,13 @@
|
|||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
|
<customwidgets>
|
||||||
|
<customwidget>
|
||||||
|
<class>KColorButton</class>
|
||||||
|
<extends>QPushButton</extends>
|
||||||
|
<header>kcolorbutton.h</header>
|
||||||
|
</customwidget>
|
||||||
|
</customwidgets>
|
||||||
<resources/>
|
<resources/>
|
||||||
<connections/>
|
<connections/>
|
||||||
</ui>
|
</ui>
|
||||||
|
|||||||
Reference in New Issue
Block a user