Add support for alignment flags to wxStaticText in wxQt
Ensure static text fields use the alignment specified by WX on creation. Closes https://github.com/wxWidgets/wxWidgets/pull/1381
This commit is contained in:
committed by
Vadim Zeitlin
parent
e5ba6d9393
commit
0f49825d64
Submodule src/expat updated: b99766ce61...ff2299e5f0
@@ -55,6 +55,15 @@ bool wxStaticText::Create(wxWindow *parent,
|
||||
m_qtLabel->setBuddy( m_qtLabel );
|
||||
m_qtLabel->setTextInteractionFlags( Qt::NoTextInteraction );
|
||||
|
||||
// Translate the WX horizontal alignment flags to Qt alignment flags
|
||||
// (notice that wxALIGN_LEFT is default and has the value of 0).
|
||||
if ( style & wxALIGN_CENTER_HORIZONTAL )
|
||||
m_qtLabel->setAlignment(Qt::AlignHCenter);
|
||||
else if ((style & wxALIGN_MASK) == wxALIGN_RIGHT)
|
||||
m_qtLabel->setAlignment(Qt::AlignRight);
|
||||
else
|
||||
m_qtLabel->setAlignment(Qt::AlignLeft);
|
||||
|
||||
return QtCreateControl( parent, id, pos, size, style, wxDefaultValidator, name );
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user