mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Added updateUiIconFromState() in cafPdmUiItem to create disabled icons based on object state
Use updateUiIconFromState() from collection objects p4#: 21459
This commit is contained in:
@@ -78,7 +78,7 @@ RimReservoirView* RimCellPropertyFilterCollection::reservoirView()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimCellPropertyFilterCollection::fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue)
|
||||
{
|
||||
updateIconState();
|
||||
this->updateUiIconFromState(active);
|
||||
|
||||
m_reservoirView->fieldChangedByUi(&(m_reservoirView->propertyFilterCollection), oldValue, newValue);
|
||||
}
|
||||
@@ -173,30 +173,6 @@ bool RimCellPropertyFilterCollection::hasActiveDynamicFilters() const
|
||||
return false;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimCellPropertyFilterCollection::updateIconState()
|
||||
{
|
||||
// Reset dynamic icon
|
||||
this->setUiIcon(QIcon());
|
||||
// Get static one
|
||||
QIcon icon = this->uiIcon();
|
||||
|
||||
// Get a pixmap, and modify it
|
||||
|
||||
QPixmap icPixmap;
|
||||
icPixmap = icon.pixmap(16, 16, QIcon::Normal);
|
||||
|
||||
if (!active)
|
||||
{
|
||||
QIcon temp(icPixmap);
|
||||
icPixmap = temp.pixmap(16, 16, QIcon::Disabled);
|
||||
}
|
||||
|
||||
QIcon newIcon(icPixmap);
|
||||
this->setUiIcon(newIcon);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
|
||||
Reference in New Issue
Block a user