Skip to content

Commit 5c7fd20

Browse files
committed
Fix truncated symbol name text in style manager dialog
1 parent d5e0d33 commit 5c7fd20

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

src/gui/symbology/qgsstylemanagerdialog.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,6 @@ void QgsStyleManagerDialog::tabItemType_currentChanged( int )
255255

256256
double iconSize = Qgis::UI_SCALE_FACTOR * fontMetrics().width( 'X' ) * 10;
257257
listItems->setIconSize( QSize( static_cast< int >( iconSize ), static_cast< int >( iconSize * 0.9 ) ) ); // ~100, 90 on low dpi
258-
listItems->setGridSize( QSize( static_cast< int >( iconSize * 1.2 ), static_cast< int >( iconSize * 1.1 ) ) ); // ~120,110 on low dpi
259258

260259
populateList();
261260
}
@@ -287,6 +286,9 @@ void QgsStyleManagerDialog::populateSymbols( const QStringList &symbolNames, boo
287286
QIcon icon = QgsSymbolLayerUtils::symbolPreviewIcon( symbol.get(), listItems->iconSize(), static_cast< int >( listItems->iconSize().width() * 0.16 ) );
288287
item->setIcon( icon );
289288
item->setData( name ); // used to find out original name when user edited the name
289+
QFont f = item->data( Qt::FontRole ).value< QFont >();
290+
f.setPointSize( 9 );
291+
item->setData( f, Qt::FontRole );
290292
item->setCheckable( check );
291293
item->setToolTip( QStringLiteral( "<b>%1</b><br><i>%2</i>" ).arg( name, tags.count() > 0 ? tags.join( QStringLiteral( ", " ) ) : tr( "Not tagged" ) ) );
292294
// add to model

src/ui/qgsstylemanagerdialogbase.ui

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -237,10 +237,13 @@
237237
</property>
238238
<property name="iconSize">
239239
<size>
240-
<width>0</width>
241-
<height>0</height>
240+
<width>77</width>
241+
<height>70</height>
242242
</size>
243243
</property>
244+
<property name="textElideMode">
245+
<enum>Qt::ElideNone</enum>
246+
</property>
244247
<property name="movement">
245248
<enum>QListView::Static</enum>
246249
</property>
@@ -250,12 +253,6 @@
250253
<property name="spacing">
251254
<number>5</number>
252255
</property>
253-
<property name="gridSize">
254-
<size>
255-
<width>0</width>
256-
<height>0</height>
257-
</size>
258-
</property>
259256
<property name="viewMode">
260257
<enum>QListView::IconMode</enum>
261258
</property>

0 commit comments

Comments
 (0)