Skip to content
Permalink
Browse files

Merge pull request #5820 from elpaso/colorramp-hidpi

Adjust colorramp height on HiDPI screens
  • Loading branch information
elpaso committed Dec 9, 2017
2 parents 53ebe05 + e4cf065 commit fb28adfb4ad3370a3626a339a267ffae72380896
Showing with 8 additions and 4 deletions.
  1. +3 −2 src/gui/qgscolorrampbutton.cpp
  2. +5 −2 src/gui/symbology/qgscategorizedsymbolrendererwidget.cpp
@@ -67,9 +67,10 @@ QSize QgsColorRampButton::sizeHint() const
{
//make sure height of button looks good under different platforms
#ifdef Q_OS_WIN
return QSize( 120, 22 );
return QSize( 120, static_cast<int>( std::max( Qgis::UI_SCALE_FACTOR * fontMetrics().height( ), 22.0 ) ) );
#else
return QSize( 120, 28 );
// Adjust height for HiDPI screens
return QSize( 120, static_cast<int>( std::max( Qgis::UI_SCALE_FACTOR * fontMetrics().height( ) * 1.4, 28.0 ) ) );
#endif
}

@@ -64,9 +64,12 @@ void QgsCategorizedSymbolRendererModel::setRenderer( QgsCategorizedSymbolRendere
}
if ( renderer )
{
beginInsertRows( QModelIndex(), 0, renderer->categories().size() - 1 );
mRenderer = renderer;
endInsertRows();
if ( renderer->categories().size() > 0 )
{
beginInsertRows( QModelIndex(), 0, renderer->categories().size() - 1 );
endInsertRows();
}
}
}

0 comments on commit fb28adf

Please sign in to comment.
You can’t perform that action at this time.