mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#4282 Let ComboBoxEditor be narrowed smaller than full text string by default
This commit is contained in:
parent
c1a5397a6f
commit
8e6ac03c75
@ -215,6 +215,11 @@ void PdmUiComboBoxEditor::configureAndUpdateUi(const QString& uiConfigName)
|
||||
{
|
||||
m_comboBox->setSizeAdjustPolicy(QComboBox::AdjustToContents);
|
||||
}
|
||||
else if (attributes.minimumContentsLength > 0)
|
||||
{
|
||||
m_comboBox->setSizeAdjustPolicy(QComboBox::AdjustToMinimumContentsLength);
|
||||
m_comboBox->setMinimumContentsLength(attributes.minimumContentsLength);
|
||||
}
|
||||
|
||||
m_comboBox->blockSignals(false);
|
||||
}
|
||||
|
@ -58,14 +58,17 @@ class PdmUiComboBoxEditorAttribute : public PdmUiEditorAttribute
|
||||
public:
|
||||
PdmUiComboBoxEditorAttribute()
|
||||
{
|
||||
adjustWidthToContents = false;
|
||||
adjustWidthToContents = false;
|
||||
showPreviousAndNextButtons = false;
|
||||
minimumContentsLength = 8;
|
||||
}
|
||||
|
||||
public:
|
||||
bool adjustWidthToContents;
|
||||
bool showPreviousAndNextButtons;
|
||||
|
||||
int minimumContentsLength; // The length of string to adjust to if adjustWidthToContents = false.
|
||||
// Set to <= 0 to ignore and use AdjustToContentsOnFirstShow instead
|
||||
|
||||
QString nextButtonText;
|
||||
QString prevButtonText;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user