diff --git a/ApplicationCode/Commands/SummaryPlotCommands/RicClearSourceSteppingEnsembleCurveSetFeature.cpp b/ApplicationCode/Commands/SummaryPlotCommands/RicClearSourceSteppingEnsembleCurveSetFeature.cpp index 0d93905fa1..b715c7323e 100644 --- a/ApplicationCode/Commands/SummaryPlotCommands/RicClearSourceSteppingEnsembleCurveSetFeature.cpp +++ b/ApplicationCode/Commands/SummaryPlotCommands/RicClearSourceSteppingEnsembleCurveSetFeature.cpp @@ -37,7 +37,26 @@ CAF_CMD_SOURCE_INIT(RicClearSourceSteppingEnsembleCurveSetFeature, "RicClearSour //-------------------------------------------------------------------------------------------------- bool RicClearSourceSteppingEnsembleCurveSetFeature::isCommandEnabled() { - return true; + std::vector objects; + caf::SelectionManager::instance()->objectsByType(&objects); + + if (objects.size() == 1) + { + auto c = objects[0]; + + RimSummaryPlot* summaryPlot = nullptr; + c->firstAncestorOrThisOfTypeAsserted(summaryPlot); + if (summaryPlot) + { + if (summaryPlot->ensembleCurveSetCollection()->curveSetForSourceStepping() + || summaryPlot->summaryCurveCollection()->curveForSourceStepping()) + { + return true; + } + } + } + + return false; } //-------------------------------------------------------------------------------------------------- @@ -91,5 +110,5 @@ void RicClearSourceSteppingEnsembleCurveSetFeature::clearAllSourceSteppingInSumm void RicClearSourceSteppingEnsembleCurveSetFeature::setupActionLook(QAction* actionToSetup) { actionToSetup->setText("Clear Source Stepping Curve Set"); - actionToSetup->setIcon(QIcon(":/updownarrow.png")); + actionToSetup->setIcon(QIcon(":/StepUpDown16x16.png")); } diff --git a/ApplicationCode/Commands/SummaryPlotCommands/RicClearSourceSteppingSummaryCurveFeature.cpp b/ApplicationCode/Commands/SummaryPlotCommands/RicClearSourceSteppingSummaryCurveFeature.cpp index 226bcfb6ce..56490344d3 100644 --- a/ApplicationCode/Commands/SummaryPlotCommands/RicClearSourceSteppingSummaryCurveFeature.cpp +++ b/ApplicationCode/Commands/SummaryPlotCommands/RicClearSourceSteppingSummaryCurveFeature.cpp @@ -28,6 +28,7 @@ #include "cafSelectionManager.h" #include +#include "RimEnsembleCurveSetCollection.h" CAF_CMD_SOURCE_INIT(RicClearSourceSteppingSummaryCurveFeature, "RicClearSourceSteppingSummaryCurveFeature"); @@ -36,7 +37,26 @@ CAF_CMD_SOURCE_INIT(RicClearSourceSteppingSummaryCurveFeature, "RicClearSourceSt //-------------------------------------------------------------------------------------------------- bool RicClearSourceSteppingSummaryCurveFeature::isCommandEnabled() { - return true; + std::vector objects; + caf::SelectionManager::instance()->objectsByType(&objects); + + if (objects.size() == 1) + { + auto c = objects[0]; + + RimSummaryPlot* summaryPlot = nullptr; + c->firstAncestorOrThisOfTypeAsserted(summaryPlot); + if (summaryPlot) + { + if (summaryPlot->ensembleCurveSetCollection()->curveSetForSourceStepping() + || summaryPlot->summaryCurveCollection()->curveForSourceStepping()) + { + return true; + } + } + } + + return false; } //-------------------------------------------------------------------------------------------------- @@ -66,5 +86,5 @@ void RicClearSourceSteppingSummaryCurveFeature::onActionTriggered(bool isChecked void RicClearSourceSteppingSummaryCurveFeature::setupActionLook(QAction* actionToSetup) { actionToSetup->setText("Clear Source Stepping Curve"); - actionToSetup->setIcon(QIcon(":/updownarrow.png")); + actionToSetup->setIcon(QIcon(":/StepUpDown16x16.png")); } diff --git a/ApplicationCode/Commands/SummaryPlotCommands/RicSetSourceSteppingEnsembleCurveSetFeature.cpp b/ApplicationCode/Commands/SummaryPlotCommands/RicSetSourceSteppingEnsembleCurveSetFeature.cpp index 41f58fbc09..fec1dbfcc8 100644 --- a/ApplicationCode/Commands/SummaryPlotCommands/RicSetSourceSteppingEnsembleCurveSetFeature.cpp +++ b/ApplicationCode/Commands/SummaryPlotCommands/RicSetSourceSteppingEnsembleCurveSetFeature.cpp @@ -94,5 +94,5 @@ void RicSetSourceSteppingEnsembleCurveSetFeature::onActionTriggered(bool isCheck void RicSetSourceSteppingEnsembleCurveSetFeature::setupActionLook(QAction* actionToSetup) { actionToSetup->setText("Set as Source Stepping Curve Set"); - actionToSetup->setIcon(QIcon(":/updownarrow.png")); + actionToSetup->setIcon(QIcon(":/StepUpDown16x16.png")); } diff --git a/ApplicationCode/Commands/SummaryPlotCommands/RicSetSourceSteppingSummaryCurveFeature.cpp b/ApplicationCode/Commands/SummaryPlotCommands/RicSetSourceSteppingSummaryCurveFeature.cpp index 87be98f560..153d664cd6 100644 --- a/ApplicationCode/Commands/SummaryPlotCommands/RicSetSourceSteppingSummaryCurveFeature.cpp +++ b/ApplicationCode/Commands/SummaryPlotCommands/RicSetSourceSteppingSummaryCurveFeature.cpp @@ -94,5 +94,5 @@ void RicSetSourceSteppingSummaryCurveFeature::onActionTriggered(bool isChecked) void RicSetSourceSteppingSummaryCurveFeature::setupActionLook(QAction* actionToSetup) { actionToSetup->setText("Set as Source Stepping Curve"); - actionToSetup->setIcon(QIcon(":/updownarrow.png")); + actionToSetup->setIcon(QIcon(":/StepUpDown16x16.png")); } diff --git a/ApplicationCode/ProjectDataModel/Summary/RimEnsembleCurveSet.cpp b/ApplicationCode/ProjectDataModel/Summary/RimEnsembleCurveSet.cpp index 83c13f947c..9b9c41119a 100644 --- a/ApplicationCode/ProjectDataModel/Summary/RimEnsembleCurveSet.cpp +++ b/ApplicationCode/ProjectDataModel/Summary/RimEnsembleCurveSet.cpp @@ -670,7 +670,12 @@ void RimEnsembleCurveSet::defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrd this->firstAncestorOrThisOfType(coll); if (coll && coll->curveSetForSourceStepping() == this) { - icon = QIcon(":/updownarrow.png"); + QPixmap combined = icon.pixmap(16, 16); + QPainter painter(&combined); + QPixmap updownpixmap(":/StepUpDownCorner16x16.png"); + painter.drawPixmap(0,0,updownpixmap); + + icon = QIcon(combined); } this->setUiIcon(icon); diff --git a/ApplicationCode/ProjectDataModel/Summary/RimSummaryCurve.cpp b/ApplicationCode/ProjectDataModel/Summary/RimSummaryCurve.cpp index f18edd006c..d513634176 100644 --- a/ApplicationCode/ProjectDataModel/Summary/RimSummaryCurve.cpp +++ b/ApplicationCode/ProjectDataModel/Summary/RimSummaryCurve.cpp @@ -581,7 +581,12 @@ void RimSummaryCurve::defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrderin this->firstAncestorOrThisOfType(coll); if (coll && coll->curveForSourceStepping() == this) { - icon = QIcon(":/updownarrow.png"); + QPixmap combined = icon.pixmap(16, 16); + QPainter painter(&combined); + QPixmap updownpixmap(":/StepUpDownCorner16x16.png"); + painter.drawPixmap(0,0,updownpixmap); + + icon = QIcon(combined); } this->setUiIcon(icon); diff --git a/ApplicationCode/Resources/ResInsight.qrc b/ApplicationCode/Resources/ResInsight.qrc index 12b6cf613c..c0353f52ce 100644 --- a/ApplicationCode/Resources/ResInsight.qrc +++ b/ApplicationCode/Resources/ResInsight.qrc @@ -140,7 +140,8 @@ ToggleOnOff16x16.png ToggleOnOthersOff16x16.png ExportCompletionsSymbol16x16.png - updownarrow.png + StepUpDown16x16.png + StepUpDownCorner16x16.png fs_CellFace.glsl diff --git a/ApplicationCode/Resources/StepUpDown16x16.png b/ApplicationCode/Resources/StepUpDown16x16.png new file mode 100644 index 0000000000..96caf453cc Binary files /dev/null and b/ApplicationCode/Resources/StepUpDown16x16.png differ diff --git a/ApplicationCode/Resources/StepUpDownCorner16x16.png b/ApplicationCode/Resources/StepUpDownCorner16x16.png new file mode 100644 index 0000000000..8d410e2983 Binary files /dev/null and b/ApplicationCode/Resources/StepUpDownCorner16x16.png differ diff --git a/ApplicationCode/Resources/updownarrow.png b/ApplicationCode/Resources/updownarrow.png deleted file mode 100644 index 7407a4c85b..0000000000 Binary files a/ApplicationCode/Resources/updownarrow.png and /dev/null differ