mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-25 00:58:06 -05:00
Fix size of some color widgets on hidpi displays
This commit is contained in:
parent
aacc316eed
commit
f121286e38
@ -397,7 +397,8 @@ QgsColorWheel::~QgsColorWheel()
|
||||
|
||||
QSize QgsColorWheel::sizeHint() const
|
||||
{
|
||||
return QSize( 200, 200 );
|
||||
int size = fontMetrics().width( QStringLiteral( "XXXXXXXXXXXXXXXXXXXXXX" ) );
|
||||
return QSize( size, size );
|
||||
}
|
||||
|
||||
void QgsColorWheel::paintEvent( QPaintEvent *event )
|
||||
@ -757,7 +758,8 @@ QgsColorBox::~QgsColorBox()
|
||||
|
||||
QSize QgsColorBox::sizeHint() const
|
||||
{
|
||||
return QSize( 200, 200 );
|
||||
int size = fontMetrics().width( QStringLiteral( "XXXXXXXXXXXXXXXXXXXXXX" ) );
|
||||
return QSize( size, size );
|
||||
}
|
||||
|
||||
void QgsColorBox::paintEvent( QPaintEvent *event )
|
||||
@ -989,12 +991,12 @@ QSize QgsColorRampWidget::sizeHint() const
|
||||
if ( mOrientation == QgsColorRampWidget::Horizontal )
|
||||
{
|
||||
//horizontal
|
||||
return QSize( 200, 28 );
|
||||
return QSize( fontMetrics().width( QStringLiteral( "XXXXXXXXXXXXXXXXXXXXXX" ) ), fontMetrics().height() * 1.3 );
|
||||
}
|
||||
else
|
||||
{
|
||||
//vertical
|
||||
return QSize( 18, 200 );
|
||||
return QSize( fontMetrics().height() * 1.3, fontMetrics().width( QStringLiteral( "XXXXXXXXXXXXXXXXXXXXXX" ) ) );
|
||||
}
|
||||
}
|
||||
|
||||
@ -1596,7 +1598,7 @@ void QgsColorPreviewWidget::paintEvent( QPaintEvent *event )
|
||||
|
||||
QSize QgsColorPreviewWidget::sizeHint() const
|
||||
{
|
||||
return QSize( 200, 150 );
|
||||
return QSize( fontMetrics().width( QStringLiteral( "XXXXXXXXXXXXXXXXXXXXXX" ) ), fontMetrics().width( QStringLiteral( "XXXXXXXXXXXXXXXXXXXXXX" ) ) * 0.75 );
|
||||
}
|
||||
|
||||
void QgsColorPreviewWidget::setColor2( const QColor &color )
|
||||
|
Loading…
x
Reference in New Issue
Block a user