Honor text alignment for spin controls in wxQt

Add support for wxALIGN_CENTRE_HORIZONTAL and wxALIGN_RIGHT flags.

Closes https://github.com/wxWidgets/wxWidgets/pull/1108
This commit is contained in:
Cătălin Răceanu
2019-01-02 03:09:00 +02:00
committed by Vadim Zeitlin
parent 0e0bf07888
commit 2a9462a260

View File

@@ -40,6 +40,11 @@ bool wxSpinCtrlQt< T, Widget >::Create( wxWindow *parent, wxWindowID id,
if ( style & wxSP_WRAP )
m_qtSpinBox->setWrapping(true);
if ( style & wxALIGN_CENTRE_HORIZONTAL )
m_qtSpinBox->setAlignment(Qt::AlignHCenter);
else if ( style & wxALIGN_RIGHT )
m_qtSpinBox->setAlignment(Qt::AlignRight);
m_qtSpinBox->setAccelerated(true); // to match gtk behavior
SetRange( min, max );