From: vsv Date: Fri, 26 Jun 2020 09:26:32 +0000 (+0300) Subject: Issue #3236: Provide icons for extrusions X-Git-Tag: V9_6_0a1~60^2~38 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=0f31b19c1a4208e3021259ccba85889a7a29add5;p=modules%2Fshaper.git Issue #3236: Provide icons for extrusions --- diff --git a/src/FeaturesPlugin/extrusion_widget.xml b/src/FeaturesPlugin/extrusion_widget.xml index 138b4dca3..97e02b9c3 100644 --- a/src/FeaturesPlugin/extrusion_widget.xml +++ b/src/FeaturesPlugin/extrusion_widget.xml @@ -6,6 +6,7 @@ 2. An existing sketch face or contour. Extrusion will be filled by it.<br /> 3. An existing result shape of kind: wires/edge/vertices. Extrusion will be filled by it." shape_types="Vertices Edges Faces" + type_icons=":/icons/extrusion_vertex32.png :/icons/extrusion_edge32.png :/icons/extrusion_face32.png" default_type = "2" use_choice="true"> @@ -14,6 +15,7 @@ label="Base objects:" tooltip="Select a base objects" shape_types="Vertices Edges Faces" + type_icons=":/icons/extrusion_vertex32.png :/icons/extrusion_edge32.png :/icons/extrusion_face32.png" default_type = "2" use_choice="true" concealment="true"> diff --git a/src/FeaturesPlugin/extrusionfuse_widget.xml b/src/FeaturesPlugin/extrusionfuse_widget.xml index 7596c09e7..78b9eb131 100644 --- a/src/FeaturesPlugin/extrusionfuse_widget.xml +++ b/src/FeaturesPlugin/extrusionfuse_widget.xml @@ -7,6 +7,7 @@ 2. An existing sketch face or contour. Extrusion will be filled by it.<br /> 3. An existing result shape of kind: wires/edge/vertices. Extrusion will be filled by it." shape_types="Vertices Edges Faces" + type_icons=":/icons/extrusion_vertex32.png :/icons/extrusion_edge32.png :/icons/extrusion_face32.png" default_type = "2" use_choice="true"> @@ -16,6 +17,7 @@ icon="icons/Features/sketch.png" tooltip="Select a sketch face" shape_types="Vertices Edges Faces" + type_icons=":/icons/extrusion_vertex32.png :/icons/extrusion_edge32.png :/icons/extrusion_face32.png" default_type = "2" use_choice="true" concealment="true"> diff --git a/src/FeaturesPlugin/revolution_widget.xml b/src/FeaturesPlugin/revolution_widget.xml index d8ec39801..dd06cb433 100644 --- a/src/FeaturesPlugin/revolution_widget.xml +++ b/src/FeaturesPlugin/revolution_widget.xml @@ -6,6 +6,7 @@ 2. An existing sketch face or contour. Extrusion will be filled by it.<br /> 3. An existing result shape of kind: wires/edge/vertices. Extrusion will be filled by it." shape_types="Vertices Edges Faces" + type_icons=":/icons/extrusion_vertex32.png :/icons/extrusion_edge32.png :/icons/extrusion_face32.png" default_type = "2" use_choice="true"> @@ -14,6 +15,7 @@ label="Base objects:" tooltip="Select a base objects" shape_types="Vertices Edges Faces" + type_icons=":/icons/extrusion_vertex32.png :/icons/extrusion_edge32.png :/icons/extrusion_face32.png" default_type = "2" use_choice="true" concealment="true"> diff --git a/src/FeaturesPlugin/revolutionfuse_widget.xml b/src/FeaturesPlugin/revolutionfuse_widget.xml index bcde5490f..aaca18add 100644 --- a/src/FeaturesPlugin/revolutionfuse_widget.xml +++ b/src/FeaturesPlugin/revolutionfuse_widget.xml @@ -7,6 +7,7 @@ 2. An existing sketch face or contour. Extrusion will be filled by it.<br /> 3. An existing result shape of kind: wires/edge/vertices. Extrusion will be filled by it." shape_types="Vertices Edges Faces" + type_icons=":/icons/extrusion_vertex32.png :/icons/extrusion_edge32.png :/icons/extrusion_face32.png" default_type = "2" use_choice="true"> @@ -16,6 +17,7 @@ icon="icons/Features/sketch.png" tooltip="Select a sketch face" shape_types="Vertices Edges Faces" + type_icons=":/icons/extrusion_vertex32.png :/icons/extrusion_edge32.png :/icons/extrusion_face32.png" default_type = "2" use_choice="true" concealment="true"> diff --git a/src/ModuleBase/ModuleBase_WidgetMultiSelector.cpp b/src/ModuleBase/ModuleBase_WidgetMultiSelector.cpp index 9c4f6f9ef..5404dcf02 100644 --- a/src/ModuleBase/ModuleBase_WidgetMultiSelector.cpp +++ b/src/ModuleBase/ModuleBase_WidgetMultiSelector.cpp @@ -128,7 +128,15 @@ ModuleBase_WidgetMultiSelector::ModuleBase_WidgetMultiSelector(QWidget* theParen myMainLayout = new QVBoxLayout(this); ModuleBase_Tools::adjustMargins(myMainLayout); - QStringList aIconsList = getIconsList(myShapeTypes); + + QStringList aIconsList; + std::string aIcons = theData->getProperty("type_icons"); + if (aIcons.size() > 0) + aIconsList = QString(aIcons.c_str()).split(' ', QString::SkipEmptyParts); + + if (aIconsList.size() != myShapeTypes.size()) + aIconsList = getIconsList(myShapeTypes); + myTypeCtrl = new ModuleBase_ChoiceCtrl(this, myShapeTypes, aIconsList); myTypeCtrl->setLabel(tr("Type")); if (!myShapeTypes.empty()) { diff --git a/src/PartSet/PartSet_WidgetSketchCreator.cpp b/src/PartSet/PartSet_WidgetSketchCreator.cpp index 49d94f227..959179cc9 100644 --- a/src/PartSet/PartSet_WidgetSketchCreator.cpp +++ b/src/PartSet/PartSet_WidgetSketchCreator.cpp @@ -128,7 +128,15 @@ PartSet_WidgetSketchCreator::PartSet_WidgetSketchCreator(QWidget* theParent, std::string aTypes = theData->getProperty("shape_types"); myShapeTypes = QString(aTypes.c_str()).split(' ', QString::SkipEmptyParts); myIsUseChoice = theData->getBooleanAttribute("use_choice", false); - QStringList aIconsList = getIconsList(myShapeTypes); + + QStringList aIconsList; + std::string aIcons = theData->getProperty("type_icons"); + if (aIcons.size() > 0) + aIconsList = QString(aIcons.c_str()).split(' ', QString::SkipEmptyParts); + + if (aIconsList.size() != myShapeTypes.size()) + aIconsList = getIconsList(myShapeTypes); + myTypeCtrl = new ModuleBase_ChoiceCtrl(this, myShapeTypes, aIconsList); myTypeCtrl->setLabel(tr("Type")); if (!myShapeTypes.empty()) { diff --git a/src/PartSet/PartSet_icons.qrc b/src/PartSet/PartSet_icons.qrc index 98eb992f7..74a83a9af 100644 --- a/src/PartSet/PartSet_icons.qrc +++ b/src/PartSet/PartSet_icons.qrc @@ -1,25 +1,27 @@ - - - icons/activate.png - icons/angle_32x32.png - icons/concealed_on.png - icons/concealed_off.png - icons/deactivate.png - icons/edit.png - icons/exec_state_failed.png - icons/exec_state_invalid_parameters.png - icons/hand_point.png - icons/move_to_end.png - icons/sketch_shape.png - icons/expression.png - icons/paper_roll.png - - icons/group_edge.png - icons/group_face.png - icons/group_solid.png - icons/group_vertex.png - icons/toWork.png - icons/isFailed.png - icons/hasWarning.png - - + + + icons/activate.png + icons/angle_32x32.png + icons/concealed_on.png + icons/concealed_off.png + icons/deactivate.png + icons/edit.png + icons/exec_state_failed.png + icons/exec_state_invalid_parameters.png + icons/hand_point.png + icons/move_to_end.png + icons/sketch_shape.png + icons/expression.png + icons/paper_roll.png + icons/group_edge.png + icons/group_face.png + icons/group_solid.png + icons/group_vertex.png + icons/toWork.png + icons/isFailed.png + icons/hasWarning.png + icons/extrusion_edge32.png + icons/extrusion_face32.png + icons/extrusion_vertex32.png + + diff --git a/src/PartSet/icons/extrusion_edge32.png b/src/PartSet/icons/extrusion_edge32.png new file mode 100644 index 000000000..6a9607fb1 Binary files /dev/null and b/src/PartSet/icons/extrusion_edge32.png differ diff --git a/src/PartSet/icons/extrusion_face32.png b/src/PartSet/icons/extrusion_face32.png new file mode 100644 index 000000000..bd4b9251d Binary files /dev/null and b/src/PartSet/icons/extrusion_face32.png differ diff --git a/src/PartSet/icons/extrusion_vertex32.png b/src/PartSet/icons/extrusion_vertex32.png new file mode 100644 index 000000000..6988ae390 Binary files /dev/null and b/src/PartSet/icons/extrusion_vertex32.png differ