Skip to content

Commit 0802586

Browse files
committedJul 7, 2017
Fix minimum height of font buttons on non-Windows platforms
1 parent b500080 commit 0802586

File tree

3 files changed

+14
-0
lines changed

3 files changed

+14
-0
lines changed
 

‎python/gui/qgsfontbutton.sip

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ class QgsFontButton : QToolButton
4545
Use ``dialogTitle`` string to define the title to show in the text settings dialog.
4646
%End
4747

48+
virtual QSize minimumSizeHint() const;
49+
4850
QgsFontButton::Mode mode() const;
4951
%Docstring
5052
Returns the current button mode.

‎src/gui/qgsfontbutton.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,16 @@ QgsFontButton::QgsFontButton( QWidget *parent, const QString &dialogTitle )
4848
setPopupMode( QToolButton::MenuButtonPopup );
4949
}
5050

51+
QSize QgsFontButton::minimumSizeHint() const
52+
{
53+
//make sure height of button looks good under different platforms
54+
#ifdef Q_OS_WIN
55+
return QToolButton::minimumSizeHint();
56+
#else
57+
return QSize( 120, 28 );
58+
#endif
59+
}
60+
5161
void QgsFontButton::showSettingsDialog()
5262
{
5363
switch ( mMode )

‎src/gui/qgsfontbutton.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@ class GUI_EXPORT QgsFontButton : public QToolButton
6666
*/
6767
QgsFontButton( QWidget *parent SIP_TRANSFERTHIS = nullptr, const QString &dialogTitle = QString() );
6868

69+
virtual QSize minimumSizeHint() const override;
70+
6971
/**
7072
* Returns the current button mode.
7173
* \see setMode()

0 commit comments

Comments
 (0)
Please sign in to comment.