mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#3898, #3899, #3900 Better source stepping command icons. Combine curve and stepping icons. Improved Clear source curve command enabling
This commit is contained in:
parent
db78e07fcf
commit
07f8221676
@ -36,9 +36,28 @@ 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"));
|
||||
}
|
||||
|
@ -28,6 +28,7 @@
|
||||
#include "cafSelectionManager.h"
|
||||
|
||||
#include <QAction>
|
||||
#include "RimEnsembleCurveSetCollection.h"
|
||||
|
||||
CAF_CMD_SOURCE_INIT(RicClearSourceSteppingSummaryCurveFeature, "RicClearSourceSteppingSummaryCurveFeature");
|
||||
|
||||
@ -35,9 +36,28 @@ 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"));
|
||||
}
|
||||
|
@ -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"));
|
||||
}
|
||||
|
@ -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"));
|
||||
}
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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>
|
||||
|
BIN
ApplicationCode/Resources/StepUpDown16x16.png
Normal file
BIN
ApplicationCode/Resources/StepUpDown16x16.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.1 KiB |
BIN
ApplicationCode/Resources/StepUpDownCorner16x16.png
Normal file
BIN
ApplicationCode/Resources/StepUpDownCorner16x16.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.3 KiB |
Binary file not shown.
Before Width: | Height: | Size: 531 B |
Loading…
Reference in New Issue
Block a user