Skip to content
Permalink
Browse files
Fix usability issue in pluginmanager
The height of rows is too small to see its
contents on hidpi screens

Also raised maximumSize of mPluginsTabFrame
  • Loading branch information
elpaso authored and m-kuhn committed May 27, 2015
1 parent 08dd620 commit 90b796c693ab176e33f71c0d8e95bb0008bb6a6b
Showing with 7 additions and 5 deletions.
  1. +6 −4 src/app/pluginmanager/qgspluginitemdelegate.cpp
  2. +1 −1 src/ui/qgspluginmanagerbase.ui
@@ -31,7 +31,9 @@ QSize QgsPluginItemDelegate::sizeHint( const QStyleOptionViewItem & option, cons
{
Q_UNUSED( option );
Q_UNUSED( index );
return QSize( 20, 20 );
// Calculate row height, adds some 20% padding
int pixelsHigh = int(QApplication::fontMetrics().height() * 1.2);
return QSize( pixelsHigh, pixelsHigh );
}


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

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

// Draw the text
@@ -92,8 +95,7 @@ void QgsPluginItemDelegate::paint( QPainter *painter, const QStyleOptionViewItem
font.setBold( true );
painter->setFont( font );
}

painter->drawText( option.rect.left() + 48, option.rect.bottom() - 3, index.data( Qt::DisplayRole ).toString() );
painter->drawText( option.rect.left() + int( pixelsHigh * 2.3 ), option.rect.bottom() - int( pixelsHigh / 6), index.data( Qt::DisplayRole ).toString() );

painter->restore();
}
@@ -46,7 +46,7 @@
</property>
<property name="maximumSize">
<size>
<width>200</width>
<width>400</width>
<height>16777215</height>
</size>
</property>

0 comments on commit 90b796c

Please sign in to comment.