#3898, #3899, #3900 Better source stepping command icons. Combine curve and stepping icons. Improved Clear source curve command enabling

This commit is contained in:
Jacob Støren 2018-12-18 17:15:54 +01:00
parent db78e07fcf
commit 07f8221676
10 changed files with 59 additions and 9 deletions

View File

@ -37,7 +37,26 @@ CAF_CMD_SOURCE_INIT(RicClearSourceSteppingEnsembleCurveSetFeature, "RicClearSour
//--------------------------------------------------------------------------------------------------
bool RicClearSourceSteppingEnsembleCurveSetFeature::isCommandEnabled()
{
std::vector<caf::PdmObject*> 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"));
}

View File

@ -28,6 +28,7 @@
#include "cafSelectionManager.h"
#include <QAction>
#include "RimEnsembleCurveSetCollection.h"
CAF_CMD_SOURCE_INIT(RicClearSourceSteppingSummaryCurveFeature, "RicClearSourceSteppingSummaryCurveFeature");
@ -36,7 +37,26 @@ CAF_CMD_SOURCE_INIT(RicClearSourceSteppingSummaryCurveFeature, "RicClearSourceSt
//--------------------------------------------------------------------------------------------------
bool RicClearSourceSteppingSummaryCurveFeature::isCommandEnabled()
{
std::vector<caf::PdmObject*> 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"));
}

View File

@ -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"));
}

View File

@ -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"));
}

View File

@ -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);

View File

@ -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);

View File

@ -140,7 +140,8 @@
<file>ToggleOnOff16x16.png</file>
<file>ToggleOnOthersOff16x16.png</file>
<file>ExportCompletionsSymbol16x16.png</file>
<file>updownarrow.png</file>
<file>StepUpDown16x16.png</file>
<file>StepUpDownCorner16x16.png</file>
</qresource>
<qresource prefix="/Shader/">
<file>fs_CellFace.glsl</file>

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 531 B