Reorder curve calculator to use more of available screen space

This commit is contained in:
Magne Sjaastad 2023-09-20 12:47:35 +02:00
parent f3ea5b39f1
commit cde05458f2
2 changed files with 9 additions and 11 deletions

View File

@ -62,6 +62,7 @@ RimSummaryCalculation::RimSummaryCalculation()
CAF_PDM_InitObject( "RimSummaryCalculation", ":/octave.png", "Calculation", "" ); CAF_PDM_InitObject( "RimSummaryCalculation", ":/octave.png", "Calculation", "" );
CAF_PDM_InitField( &m_distributeToOtherItems, "DistributeToOtherItems", true, "Distribute to other items (wells, groups, ..)" ); CAF_PDM_InitField( &m_distributeToOtherItems, "DistributeToOtherItems", true, "Distribute to other items (wells, groups, ..)" );
caf::PdmUiNativeCheckBoxEditor::configureFieldForEditor( &m_distributeToOtherItems );
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
@ -200,18 +201,15 @@ bool RimSummaryCalculation::detectCyclicCalculation( int id, std::set<int>& ids
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RimSummaryCalculation::defineEditorAttribute( const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute* attribute ) void RimSummaryCalculation::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering )
{ {
RimUserDefinedCalculation::defineEditorAttribute( field, uiConfigName, attribute ); RimUserDefinedCalculation::defineUiOrdering( uiConfigName, uiOrdering );
if ( field == &m_distributeToOtherItems ) // Adjust the layout to avoid a lot of unused white space in dialog
{ m_description.uiCapability()->setUiHidden( true );
auto myAttr = dynamic_cast<caf::PdmUiCheckBoxEditorAttribute*>( attribute ); m_expression.uiCapability()->setUiName( "Expression" );
if ( myAttr ) m_expression.uiCapability()->setUiLabelPosition( caf::PdmUiItemInfo::TOP );
{ m_unit.uiCapability()->setUiLabelPosition( caf::PdmUiItemInfo::TOP );
myAttr->setWordWrap( true );
}
}
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------

View File

@ -87,7 +87,7 @@ protected:
bool checkVariables() const; bool checkVariables() const;
bool detectCyclicCalculation( int id, std::set<int>& ids ) const; bool detectCyclicCalculation( int id, std::set<int>& ids ) const;
void defineEditorAttribute( const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute* attribute ) override; void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override;
private: private:
caf::PdmField<bool> m_distributeToOtherItems; caf::PdmField<bool> m_distributeToOtherItems;