#7376 Data Source Stepping : Improve icons

Icons
This commit is contained in:
Magne Sjaastad 2021-02-18 09:14:19 +01:00
parent 47d0c3ed5e
commit 6c672d9c9c
7 changed files with 45 additions and 14 deletions

View File

Before

Width:  |  Height:  |  Size: 497 B

After

Width:  |  Height:  |  Size: 497 B

View File

Before

Width:  |  Height:  |  Size: 497 B

After

Width:  |  Height:  |  Size: 497 B

View File

@ -232,6 +232,8 @@
<file>CellFilter_Polygon.png</file>
<file>undo.png</file>
<file>redo.png</file>
<file>ComboBoxDown.svg</file>
<file>ComboBoxUp.svg</file>
</qresource>
<qresource prefix="/Shader">
<file>fs_CellFace.glsl</file>

View File

@ -955,6 +955,8 @@ void RimWellLogCurveCommonDataSource::defineEditorAttribute( const caf::PdmField
if ( field == &m_case || field == &m_simWellName || field == &m_wellPath || field == &m_timeStep )
{
myAttr->showPreviousAndNextButtons = true;
myAttr->nextIcon = QIcon( ":/ComboBoxDown.svg" );
myAttr->previousIcon = QIcon( ":/ComboBoxUp.svg" );
}
QString modifierText;

View File

@ -1127,6 +1127,8 @@ void RimSummaryPlotSourceStepping::defineEditorAttribute( const caf::PdmFieldHan
if ( myAttr )
{
myAttr->showPreviousAndNextButtons = true;
myAttr->nextIcon = QIcon( ":/ComboBoxDown.svg" );
myAttr->previousIcon = QIcon( ":/ComboBoxUp.svg" );
QString modifierText;

View File

@ -315,24 +315,47 @@ void PdmUiComboBoxEditor::configureAndUpdateUi( const QString& uiConfigName )
m_layout->insertWidget( 1, m_previousItemButton );
m_layout->insertWidget( 2, m_nextItemButton );
if ( m_comboBox->count() == 0 || m_comboBox->currentIndex() <= 0 )
{
QIcon disabledIcon( stepUpIcon().pixmap( 16, 16, QIcon::Disabled ) );
m_previousItemButton->setIcon( disabledIcon );
}
else
{
m_previousItemButton->setIcon( stepUpIcon() );
QIcon toolButtonIcon;
if ( !m_attributes.previousIcon.isNull() )
{
toolButtonIcon = m_attributes.previousIcon;
}
else
{
toolButtonIcon = stepUpIcon();
}
if ( m_comboBox->count() == 0 || m_comboBox->currentIndex() <= 0 )
{
QIcon disabledIcon( toolButtonIcon.pixmap( 16, 16, QIcon::Disabled ) );
m_previousItemButton->setIcon( disabledIcon );
}
else
{
m_previousItemButton->setIcon( toolButtonIcon );
}
}
if ( m_comboBox->count() == 0 || m_comboBox->currentIndex() >= m_comboBox->count() - 1 )
{
QIcon disabledIcon( stepDownIcon().pixmap( 16, 16, QIcon::Disabled ) );
m_nextItemButton->setIcon( disabledIcon );
}
else
{
m_nextItemButton->setIcon( stepDownIcon() );
QIcon toolButtonIcon;
if ( !m_attributes.nextIcon.isNull() )
{
toolButtonIcon = m_attributes.nextIcon;
}
else
{
toolButtonIcon = stepUpIcon();
}
if ( m_comboBox->count() == 0 || m_comboBox->currentIndex() >= m_comboBox->count() - 1 )
{
QIcon disabledIcon( toolButtonIcon.pixmap( 16, 16, QIcon::Disabled ) );
m_nextItemButton->setIcon( disabledIcon );
}
else
{
m_nextItemButton->setIcon( toolButtonIcon );
}
}
// Update button texts

View File

@ -78,6 +78,8 @@ public:
QString prevButtonText;
QSize iconSize;
QIcon nextIcon;
QIcon previousIcon;
};
//==================================================================================================