Commit fa2f997e authored by Olivier Teulière's avatar Olivier Teulière

* skins2: Fixed resizing of the Text control

parent 29a03bfd
...@@ -242,7 +242,7 @@ void CtrlText::displayText( const UString &rText ) ...@@ -242,7 +242,7 @@ void CtrlText::displayText( const UString &rText )
m_pImgDouble = m_rFont.drawString( doubleStringWithSep, m_color ); m_pImgDouble = m_rFont.drawString( doubleStringWithSep, m_color );
// Update the current image used, as if the control size had changed // Update the current image used, as if the control size had changed
onChangePosition(); onPositionChange();
if( m_alignment == kRight && getPosition() && if( m_alignment == kRight && getPosition() &&
getPosition()->getWidth() < m_pImg->getWidth() ) getPosition()->getWidth() < m_pImg->getWidth() )
...@@ -281,7 +281,7 @@ void CtrlText::displayText( const UString &rText ) ...@@ -281,7 +281,7 @@ void CtrlText::displayText( const UString &rText )
} }
void CtrlText::onChangePosition() void CtrlText::onPositionChange()
{ {
if( m_pImg && getPosition() ) if( m_pImg && getPosition() )
{ {
...@@ -303,6 +303,12 @@ void CtrlText::onChangePosition() ...@@ -303,6 +303,12 @@ void CtrlText::onChangePosition()
} }
void CtrlText::onResize()
{
onPositionChange();
}
void CtrlText::CmdToManual::execute() void CtrlText::CmdToManual::execute()
{ {
EvtMouse *pEvtMouse = (EvtMouse*)m_pParent->m_pEvt; EvtMouse *pEvtMouse = (EvtMouse*)m_pParent->m_pEvt;
......
...@@ -131,7 +131,9 @@ class CtrlText: public CtrlGeneric, public Observer<VarText> ...@@ -131,7 +131,9 @@ class CtrlText: public CtrlGeneric, public Observer<VarText>
void adjust( int &position ); void adjust( int &position );
/// Update the behaviour of the text whenever the control size changes /// Update the behaviour of the text whenever the control size changes
virtual void onChangePosition(); virtual void onPositionChange();
/// Update the behaviour of the text whenever the control size changes
virtual void onResize();
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment