From: nds Date: Fri, 24 Apr 2015 14:50:39 +0000 (+0300) Subject: Corrections for extrusion/revolution xml definition and random color X-Git-Tag: V_1.2.0~183^2^2~1 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=6ac73f31213a0faadd92eed42e4e27d1b0820eaf;p=modules%2Fshaper.git Corrections for extrusion/revolution xml definition and random color --- diff --git a/src/PartSet/PartSet_icons.qrc b/src/PartSet/PartSet_icons.qrc index b37f9e71a..ffff1c6bd 100644 --- a/src/PartSet/PartSet_icons.qrc +++ b/src/PartSet/PartSet_icons.qrc @@ -1,10 +1,14 @@ + icons/angle.png + icons/angle_up.png + icons/angle_down.png icons/arc.png icons/circle.png icons/color.png icons/point.png icons/plane.png + icons/plane_inverted.png icons/axis.png icons/duplicate.png icons/remove.png @@ -19,6 +23,8 @@ icons/line.png icons/sketch.png icons/hand_point.png + icons/dimension_up.png + icons/dimension_down.png icons/dimension_v.png icons/radius.png icons/perpendicular.png diff --git a/src/PartSet/icons/angle.png b/src/PartSet/icons/angle.png new file mode 100644 index 000000000..6330d604b Binary files /dev/null and b/src/PartSet/icons/angle.png differ diff --git a/src/PartSet/icons/angle_down.png b/src/PartSet/icons/angle_down.png new file mode 100644 index 000000000..495ee7714 Binary files /dev/null and b/src/PartSet/icons/angle_down.png differ diff --git a/src/PartSet/icons/angle_up.png b/src/PartSet/icons/angle_up.png new file mode 100644 index 000000000..dc085e71e Binary files /dev/null and b/src/PartSet/icons/angle_up.png differ diff --git a/src/PartSet/icons/dimension_down.png b/src/PartSet/icons/dimension_down.png new file mode 100644 index 000000000..111720060 Binary files /dev/null and b/src/PartSet/icons/dimension_down.png differ diff --git a/src/PartSet/icons/dimension_up.png b/src/PartSet/icons/dimension_up.png new file mode 100644 index 000000000..08bd84cb3 Binary files /dev/null and b/src/PartSet/icons/dimension_up.png differ diff --git a/src/PartSet/icons/plane_inverted.png b/src/PartSet/icons/plane_inverted.png new file mode 100644 index 000000000..a13a8bba6 Binary files /dev/null and b/src/PartSet/icons/plane_inverted.png differ diff --git a/src/XGUI/XGUI_Workshop.cpp b/src/XGUI/XGUI_Workshop.cpp index 71f296c1a..8280cb14d 100644 --- a/src/XGUI/XGUI_Workshop.cpp +++ b/src/XGUI/XGUI_Workshop.cpp @@ -1529,6 +1529,9 @@ bool XGUI_Workshop::canChangeColor() const } //************************************************************** +#include +#include +#include void XGUI_Workshop::changeColor(const QObjectPtrList& theObjects) { std::vector aColor; @@ -1545,19 +1548,33 @@ void XGUI_Workshop::changeColor(const QObjectPtrList& theObjects) // 2. show the dialog to change the value QDialog* aDlg = new QDialog(); - QVBoxLayout* aLay = new QVBoxLayout(aDlg); + aDlg->setWindowTitle("Color"); + QGridLayout* aLay = new QGridLayout(aDlg); + + QRadioButton* aRandomChoiceBtn = new QRadioButton(aDlg); + QRadioButton* aColorChoiceBtn = new QRadioButton(aDlg); + aColorChoiceBtn->setChecked(true); + QButtonGroup* aGroup = new QButtonGroup(aDlg); + aGroup->setExclusive(true); + aGroup->addButton(aColorChoiceBtn); + aGroup->addButton(aRandomChoiceBtn); + + aLay->addWidget(aColorChoiceBtn, 0, 0); + aLay->addWidget(aRandomChoiceBtn, 1, 0); QtxColorButton* aColorBtn = new QtxColorButton(aDlg); aColorBtn->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); - - aLay->addWidget(aColorBtn); + aLay->addWidget(aColorBtn, 0, 1); aColorBtn->setColor(QColor(aColor[0], aColor[1], aColor[2])); + QLabel* aRandomLabel = new QLabel("Random", aDlg); + aLay->addWidget(aRandomLabel, 1, 1); + QDialogButtonBox* aButtons = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, Qt::Horizontal, aDlg); connect(aButtons, SIGNAL(accepted()), aDlg, SLOT(accept())); connect(aButtons, SIGNAL(rejected()), aDlg, SLOT(reject())); - aLay->addWidget(aButtons); + aLay->addWidget(aButtons, 2, 0, 1, 2); aDlg->move(QCursor::pos()); bool isDone = aDlg->exec() == QDialog::Accepted;