[qet] qet/qet: [5757] Add KColorButton in the shape properties editor |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/qet Archives
]
Revision: 5757
Author: blacksun
Date: 2019-03-04 16:42:53 +0100 (Mon, 04 Mar 2019)
Log Message:
-----------
Add KColorButton in the shape properties editor
Modified Paths:
--------------
trunk/sources/ui/shapegraphicsitempropertieswidget.cpp
trunk/sources/ui/shapegraphicsitempropertieswidget.h
trunk/sources/ui/shapegraphicsitempropertieswidget.ui
Modified: trunk/sources/ui/shapegraphicsitempropertieswidget.cpp
===================================================================
--- trunk/sources/ui/shapegraphicsitempropertieswidget.cpp 2019-03-04 15:34:42 UTC (rev 5756)
+++ trunk/sources/ui/shapegraphicsitempropertieswidget.cpp 2019-03-04 15:42:53 UTC (rev 5757)
@@ -380,6 +380,7 @@
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 @@
}
}
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_color_kpb_changed(const QColor &newColor)
+{
+ if (newColor.isValid())
+ {
+ setPenColorButton(newColor);
+ if (m_live_edit) {
+ apply();
+ }
+ }
+}
Modified: trunk/sources/ui/shapegraphicsitempropertieswidget.h
===================================================================
--- trunk/sources/ui/shapegraphicsitempropertieswidget.h 2019-03-04 15:34:42 UTC (rev 5756)
+++ trunk/sources/ui/shapegraphicsitempropertieswidget.h 2019-03-04 15:42:53 UTC (rev 5757)
@@ -63,6 +63,8 @@
+ void on_m_color_kpb_changed(const QColor &newColor);
+
private:
Ui::ShapeGraphicsItemPropertiesWidget *ui;
QetShapeItem *m_shape;
Modified: trunk/sources/ui/shapegraphicsitempropertieswidget.ui
===================================================================
--- trunk/sources/ui/shapegraphicsitempropertieswidget.ui 2019-03-04 15:34:42 UTC (rev 5756)
+++ trunk/sources/ui/shapegraphicsitempropertieswidget.ui 2019-03-04 15:42:53 UTC (rev 5757)
@@ -27,41 +27,31 @@
</property>
</widget>
</item>
- <item row="0" column="1">
- <widget class="QComboBox" name="m_style_cb">
- <item>
- <property name="text">
- <string>Normal</string>
- </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>
+ <item row="0" column="0">
+ <widget class="QLabel" name="label">
+ <property name="text">
+ <string>Type</string>
+ </property>
</widget>
</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">
<property name="maximumSize">
<size>
@@ -95,27 +85,40 @@
</property>
</widget>
</item>
- <item row="0" column="0">
- <widget class="QLabel" name="label">
- <property name="text">
- <string>Type</string>
- </property>
+ <item row="0" column="1" colspan="2">
+ <widget class="QComboBox" name="m_style_cb">
+ <item>
+ <property name="text">
+ <string>Normal</string>
+ </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>
</item>
- <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>
</layout>
</widget>
</item>
@@ -257,6 +260,13 @@
</item>
</layout>
</widget>
+ <customwidgets>
+ <customwidget>
+ <class>KColorButton</class>
+ <extends>QPushButton</extends>
+ <header>kcolorbutton.h</header>
+ </customwidget>
+ </customwidgets>
<resources/>
<connections/>
</ui>