]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Corrections for extrusion/revolution xml definition and random color
authornds <natalia.donis@opencascade.com>
Fri, 24 Apr 2015 14:50:39 +0000 (17:50 +0300)
committernds <natalia.donis@opencascade.com>
Fri, 24 Apr 2015 14:50:39 +0000 (17:50 +0300)
src/PartSet/PartSet_icons.qrc
src/PartSet/icons/angle.png [new file with mode: 0644]
src/PartSet/icons/angle_down.png [new file with mode: 0644]
src/PartSet/icons/angle_up.png [new file with mode: 0644]
src/PartSet/icons/dimension_down.png [new file with mode: 0644]
src/PartSet/icons/dimension_up.png [new file with mode: 0644]
src/PartSet/icons/plane_inverted.png [new file with mode: 0644]
src/XGUI/XGUI_Workshop.cpp

index b37f9e71a15296dd4da7597fd00aa8dc52b30285..ffff1c6bd43b00dd6c5e839d3c326f5e008d136e 100644 (file)
@@ -1,10 +1,14 @@
  <!DOCTYPE RCC><RCC version="1.0">
  <qresource>
+     <file>icons/angle.png</file>
+     <file>icons/angle_up.png</file>
+     <file>icons/angle_down.png</file>
      <file>icons/arc.png</file>
      <file>icons/circle.png</file>
      <file>icons/color.png</file>
      <file>icons/point.png</file>
      <file>icons/plane.png</file>
+     <file>icons/plane_inverted.png</file>
      <file>icons/axis.png</file>
      <file>icons/duplicate.png</file>
      <file>icons/remove.png</file>
@@ -19,6 +23,8 @@
      <file>icons/line.png</file>
      <file>icons/sketch.png</file>
      <file>icons/hand_point.png</file>
+     <file>icons/dimension_up.png</file>
+     <file>icons/dimension_down.png</file>
      <file>icons/dimension_v.png</file>
      <file>icons/radius.png</file>
      <file>icons/perpendicular.png</file>
diff --git a/src/PartSet/icons/angle.png b/src/PartSet/icons/angle.png
new file mode 100644 (file)
index 0000000..6330d60
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 (file)
index 0000000..495ee77
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 (file)
index 0000000..dc085e7
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 (file)
index 0000000..1117200
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 (file)
index 0000000..08bd84c
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 (file)
index 0000000..a13a8bb
Binary files /dev/null and b/src/PartSet/icons/plane_inverted.png differ
index 71f296c1a83e647b216296b78376dbcbfb0cd224..8280cb14dadbaa29249ead2a2329aad07143c7e6 100644 (file)
@@ -1529,6 +1529,9 @@ bool XGUI_Workshop::canChangeColor() const
 }
 
 //**************************************************************
+#include <QButtonGroup>
+#include <QRadioButton>
+#include <QLabel>
 void XGUI_Workshop::changeColor(const QObjectPtrList& theObjects)
 {
   std::vector<int> 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;