mirror of
				https://github.com/qgis/QGIS.git
				synced 2025-11-04 00:04:25 -05:00 
			
		
		
		
	Fix size hint for font button
This commit is contained in:
		
							parent
							
								
									99855ea35a
								
							
						
					
					
						commit
						0fd1f8e563
					
				@ -45,8 +45,6 @@ class QgsFontButton : QToolButton
 | 
			
		||||
 Use ``dialogTitle`` string to define the title to show in the text settings dialog.
 | 
			
		||||
%End
 | 
			
		||||
 | 
			
		||||
    virtual QSize sizeHint() const;
 | 
			
		||||
 | 
			
		||||
    QgsFontButton::Mode mode() const;
 | 
			
		||||
%Docstring
 | 
			
		||||
 Returns the current button mode.
 | 
			
		||||
 | 
			
		||||
@ -38,7 +38,6 @@ QgsFontButton::QgsFontButton( QWidget *parent, const QString &dialogTitle )
 | 
			
		||||
{
 | 
			
		||||
  setText( tr( "Font" ) );
 | 
			
		||||
  setAcceptDrops( true );
 | 
			
		||||
  setMinimumSize( QSize( 24, 16 ) );
 | 
			
		||||
  connect( this, &QAbstractButton::clicked, this, &QgsFontButton::showSettingsDialog );
 | 
			
		||||
 | 
			
		||||
  //setup dropdown menu
 | 
			
		||||
@ -48,16 +47,6 @@ QgsFontButton::QgsFontButton( QWidget *parent, const QString &dialogTitle )
 | 
			
		||||
  setPopupMode( QToolButton::MenuButtonPopup );
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
QSize QgsFontButton::sizeHint() const
 | 
			
		||||
{
 | 
			
		||||
  //make sure height of button looks good under different platforms
 | 
			
		||||
#ifdef Q_OS_WIN
 | 
			
		||||
  return QSize( 120, 22 );
 | 
			
		||||
#else
 | 
			
		||||
  return QSize( 120, 28 );
 | 
			
		||||
#endif
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void QgsFontButton::showSettingsDialog()
 | 
			
		||||
{
 | 
			
		||||
  switch ( mMode )
 | 
			
		||||
 | 
			
		||||
@ -66,8 +66,6 @@ class GUI_EXPORT QgsFontButton : public QToolButton
 | 
			
		||||
     */
 | 
			
		||||
    QgsFontButton( QWidget *parent SIP_TRANSFERTHIS = nullptr, const QString &dialogTitle = QString() );
 | 
			
		||||
 | 
			
		||||
    virtual QSize sizeHint() const override;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Returns the current button mode.
 | 
			
		||||
     * \see setMode()
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user