Skip to content

Commit 90b796c

Browse files
elpasom-kuhn
authored andcommitted
Fix usability issue in pluginmanager
The height of rows is too small to see its contents on hidpi screens Also raised maximumSize of mPluginsTabFrame
1 parent 08dd620 commit 90b796c

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

src/app/pluginmanager/qgspluginitemdelegate.cpp

+6-4
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,9 @@ QSize QgsPluginItemDelegate::sizeHint( const QStyleOptionViewItem & option, cons
3131
{
3232
Q_UNUSED( option );
3333
Q_UNUSED( index );
34-
return QSize( 20, 20 );
34+
// Calculate row height, adds some 20% padding
35+
int pixelsHigh = int(QApplication::fontMetrics().height() * 1.2);
36+
return QSize( pixelsHigh, pixelsHigh );
3537
}
3638

3739

@@ -40,6 +42,7 @@ void QgsPluginItemDelegate::paint( QPainter *painter, const QStyleOptionViewItem
4042
painter->save();
4143
painter->setRenderHint( QPainter::SmoothPixmapTransform );
4244
QStyle *style = QApplication::style();
45+
int pixelsHigh = QApplication::fontMetrics().height();
4346

4447
// Draw the background
4548
style->drawPrimitive( QStyle::PE_PanelItemViewItem, &option, painter, NULL );
@@ -66,7 +69,7 @@ void QgsPluginItemDelegate::paint( QPainter *painter, const QStyleOptionViewItem
6669
if ( !iconPixmap.isNull() )
6770
{
6871
int iconSize = option.rect.height();
69-
painter->drawPixmap( option.rect.left() + 24, option.rect.top(), iconSize, iconSize, iconPixmap );
72+
painter->drawPixmap( option.rect.left() + pixelsHigh , option.rect.top(), iconSize, iconSize, iconPixmap );
7073
}
7174

7275
// Draw the text
@@ -92,8 +95,7 @@ void QgsPluginItemDelegate::paint( QPainter *painter, const QStyleOptionViewItem
9295
font.setBold( true );
9396
painter->setFont( font );
9497
}
95-
96-
painter->drawText( option.rect.left() + 48, option.rect.bottom() - 3, index.data( Qt::DisplayRole ).toString() );
98+
painter->drawText( option.rect.left() + int( pixelsHigh * 2.3 ), option.rect.bottom() - int( pixelsHigh / 6), index.data( Qt::DisplayRole ).toString() );
9799

98100
painter->restore();
99101
}

src/ui/qgspluginmanagerbase.ui

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
</property>
4747
<property name="maximumSize">
4848
<size>
49-
<width>200</width>
49+
<width>400</width>
5050
<height>16777215</height>
5151
</size>
5252
</property>

0 commit comments

Comments
 (0)