mirror of
https://github.com/OPM/ResInsight.git
synced 2026-10-25 14:40:26 -05:00
#1136: Improve caf editors, label links and nested settings write
This commit is contained in:
1 parent
3de9b3c1aa
commit
4d0e377964
10 files changed
+290
-9
No files matched your search
@@ -50,6 +50,7 @@
|
||||
#include <QPainter>
|
||||
#include <QPalette>
|
||||
#include <QSortFilterProxyModel>
|
||||
#include <QStyle>
|
||||
#include <QStyleOption>
|
||||
#include <QTimer>
|
||||
#include <QTreeView>
|
||||
@@ -202,6 +203,22 @@ void PdmUiTreeSelectionEditor::configureAndUpdateUi( const QString& uiConfigName
|
||||
// use cafQTreeViewStateSerializer to restore collapsed state
|
||||
m_model->setOptions( this, options );
|
||||
|
||||
// Allow option icons larger than the default icon size
|
||||
const int smallIcon = m_treeView->style()->pixelMetric( QStyle::PM_SmallIconSize );
|
||||
QSize iconSize( smallIcon, smallIcon );
|
||||
for ( const auto& option : options )
|
||||
{
|
||||
if ( auto icon = option.icon() )
|
||||
{
|
||||
const auto sizes = icon->availableSizes();
|
||||
for ( const auto& size : sizes )
|
||||
{
|
||||
iconSize = iconSize.expandedTo( size );
|
||||
}
|
||||
}
|
||||
}
|
||||
m_treeView->setIconSize( iconSize );
|
||||
|
||||
if ( itemCountHasChaged )
|
||||
{
|
||||
m_treeView->expandAll();
|
||||
|
||||
Reference in new issue
Block a user