Improved handling of icon enabled state

This commit is contained in:
Magne Sjaastad 2014-08-01 13:35:52 +02:00
parent c579c61404
commit 0550f9df8c
10 changed files with 20 additions and 17 deletions

View File

@ -82,7 +82,7 @@ void Rim3dOverlayInfoConfig::setPosition(cvf::Vec2ui position)
//--------------------------------------------------------------------------------------------------
void Rim3dOverlayInfoConfig::update3DInfo()
{
this->updateUiIconFromState(active);
this->updateUiIconFromToggleField();
if (!m_reservoirView) return;
if (!m_reservoirView->viewer()) return;

View File

@ -76,7 +76,7 @@ RimReservoirView* RimCellPropertyFilterCollection::reservoirView()
//--------------------------------------------------------------------------------------------------
void RimCellPropertyFilterCollection::fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue)
{
this->updateUiIconFromState(active);
this->updateUiIconFromToggleField();
m_reservoirView->fieldChangedByUi(&(m_reservoirView->propertyFilterCollection), oldValue, newValue);
}
@ -131,6 +131,8 @@ void RimCellPropertyFilterCollection::loadAndInitializePropertyFilters()
void RimCellPropertyFilterCollection::initAfterRead()
{
loadAndInitializePropertyFilters();
this->updateUiIconFromToggleField();
}
//--------------------------------------------------------------------------------------------------

View File

@ -138,7 +138,7 @@ RigActiveCellInfo* RimCellRangeFilterCollection::activeCellInfo() const
//--------------------------------------------------------------------------------------------------
void RimCellRangeFilterCollection::fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue)
{
updateUiIconFromState(isActive);
this->updateUiIconFromToggleField();
CVF_ASSERT(m_reservoirView);
@ -184,8 +184,9 @@ void RimCellRangeFilterCollection::initAfterRead()
RimCellRangeFilter* rangeFilter = *it;
rangeFilter->setParentContainer(this);
rangeFilter->updateIconState();
}
this->updateUiIconFromToggleField();
}
//--------------------------------------------------------------------------------------------------

View File

@ -63,10 +63,7 @@ caf::PdmFieldHandle* RimFault::userDescriptionField()
//--------------------------------------------------------------------------------------------------
void RimFault::fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue)
{
if (&showFault == changedField)
{
this->updateUiIconFromState(showFault);
}
this->updateUiIconFromToggleField();
if (&faultColor == changedField || &showFault == changedField)
{

View File

@ -86,11 +86,8 @@ RimFaultCollection::~RimFaultCollection()
//--------------------------------------------------------------------------------------------------
void RimFaultCollection::fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue)
{
if (&showFaultCollection == changedField)
{
this->updateUiIconFromState(showFaultCollection);
}
this->updateUiIconFromToggleField();
if (&faultLabelColor == changedField)
{
m_reservoirView->scheduleReservoirGridGeometryRegen();

View File

@ -84,7 +84,7 @@ void RimFaultResultSettings::setReservoirView(RimReservoirView* ownerReservoirVi
//--------------------------------------------------------------------------------------------------
void RimFaultResultSettings::fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue)
{
this->updateUiIconFromState(showCustomFaultResult);
this->updateUiIconFromToggleField();
m_customFaultResult->fieldChangedByUi(changedField, oldValue, newValue);
@ -111,7 +111,7 @@ void RimFaultResultSettings::initAfterRead()
m_customFaultResult->initAfterRead();
updateFieldVisibility();
this->updateUiIconFromState(showCustomFaultResult);
this->updateUiIconFromToggleField();
}
//--------------------------------------------------------------------------------------------------

View File

@ -415,7 +415,7 @@ void RimReservoirView::fieldChangedByUi(const caf::PdmFieldHandle* changedField,
}
}
this->updateUiIconFromState(showWindow);
this->updateUiIconFromToggleField();
}
else if (changedField == &backgroundColor )
{
@ -974,6 +974,8 @@ void RimReservoirView::initAfterRead()
this->cellEdgeResult()->setReservoirView(this);
this->rangeFilterCollection()->setReservoirView(this);
this->propertyFilterCollection()->setReservoirView(this);
this->updateUiIconFromToggleField();
}
//--------------------------------------------------------------------------------------------------

View File

@ -293,6 +293,8 @@ void RimResultDefinition::initAfterRead()
m_porosityModelUiField = m_porosityModel;
m_resultTypeUiField = m_resultType;
m_resultVariableUiField = m_resultVariable;
this->updateUiIconFromToggleField();
}
//--------------------------------------------------------------------------------------------------

View File

@ -190,7 +190,7 @@ void RimWellCollection::fieldChangedByUi(const caf::PdmFieldHandle* changedField
{
if (&showWellLabel == changedField || &isActive == changedField)
{
this->updateUiIconFromState(isActive);
this->updateUiIconFromToggleField();
if (m_reservoirView)
{

View File

@ -89,6 +89,8 @@ void RimOilFieldEntry::fieldChangedByUi(const caf::PdmFieldHandle* changedField,
void RimOilFieldEntry::initAfterRead()
{
updateEnabledState();
this->updateUiIconFromToggleField();
}
//--------------------------------------------------------------------------------------------------