Skip to content
Permalink
Browse files

Fix minimum height of font buttons on non-Windows platforms

  • Loading branch information
nyalldawson committed Jul 7, 2017
1 parent b500080 commit 0802586a13e5f21238daf223d5d5d754bce23c7f
Showing with 14 additions and 0 deletions.
  1. +2 −0 python/gui/qgsfontbutton.sip
  2. +10 −0 src/gui/qgsfontbutton.cpp
  3. +2 −0 src/gui/qgsfontbutton.h
@@ -45,6 +45,8 @@ class QgsFontButton : QToolButton
Use ``dialogTitle`` string to define the title to show in the text settings dialog.
%End

virtual QSize minimumSizeHint() const;

QgsFontButton::Mode mode() const;
%Docstring
Returns the current button mode.
@@ -48,6 +48,16 @@ QgsFontButton::QgsFontButton( QWidget *parent, const QString &dialogTitle )
setPopupMode( QToolButton::MenuButtonPopup );
}

QSize QgsFontButton::minimumSizeHint() const
{
//make sure height of button looks good under different platforms
#ifdef Q_OS_WIN
return QToolButton::minimumSizeHint();
#else
return QSize( 120, 28 );
#endif
}

void QgsFontButton::showSettingsDialog()
{
switch ( mMode )
@@ -66,6 +66,8 @@ class GUI_EXPORT QgsFontButton : public QToolButton
*/
QgsFontButton( QWidget *parent SIP_TRANSFERTHIS = nullptr, const QString &dialogTitle = QString() );

virtual QSize minimumSizeHint() const override;

/**
* Returns the current button mode.
* \see setMode()

0 comments on commit 0802586

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