Commit 6d2b8a0a authored by Erwan Tulou's avatar Erwan Tulou

skins2: slider fix notifyLayout wrongly removed

redefining notifyLayout is mandatory for sliders, because the default
notifyLayout based on position doesn't work well for this complicated control.
This function is called when visibility is turned on or off.
parent c14d222d
...@@ -153,6 +153,24 @@ void CtrlSliderCursor::onResize() ...@@ -153,6 +153,24 @@ void CtrlSliderCursor::onResize()
} }
void CtrlSliderCursor::notifyLayout( int width, int height,
int xOffSet, int yOffSet )
{
if( width > 0 && height > 0 )
{
CtrlGeneric::notifyLayout( width, height, xOffSet, yOffSet );
}
else
{
onPositionChange();
const Position *pPos = getPosition();
CtrlGeneric::notifyLayout( m_lastCursorRect.width,
m_lastCursorRect.height,
m_lastCursorRect.x - pPos->getLeft(),
m_lastCursorRect.y - pPos->getTop() );
}
}
void CtrlSliderCursor::onUpdate( Subject<VarPercent> &rVariable, void *arg ) void CtrlSliderCursor::onUpdate( Subject<VarPercent> &rVariable, void *arg )
{ {
(void)rVariable; (void)arg; (void)rVariable; (void)arg;
......
...@@ -71,6 +71,10 @@ public: ...@@ -71,6 +71,10 @@ public:
/// Method called when the control is resized /// Method called when the control is resized
virtual void onResize(); virtual void onResize();
/// Method called to notify are to be updated
virtual void notifyLayout( int witdh = -1, int height = -1,
int xOffSet = 0, int yOffSet = 0 );
/// Get the text of the tooltip /// Get the text of the tooltip
virtual UString getTooltipText() const { return m_tooltip; } virtual UString getTooltipText() const { return m_tooltip; }
......
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