broken state changes fixed
This commit is contained in:
parent
996e849fc5
commit
4ca5e798c8
@ -1303,6 +1303,7 @@ void QskSkinnable::setSkinStates( QskAspect::States newStates )
|
|||||||
|
|
||||||
#if DEBUG_STATE
|
#if DEBUG_STATE
|
||||||
const auto className = control ? control->className() : "QskSkinnable";
|
const auto className = control ? control->className() : "QskSkinnable";
|
||||||
|
|
||||||
qDebug() << className << ":"
|
qDebug() << className << ":"
|
||||||
<< skinStateAsPrintable( m_data->skinState ) << "->"
|
<< skinStateAsPrintable( m_data->skinState ) << "->"
|
||||||
<< skinStateAsPrintable( newState );
|
<< skinStateAsPrintable( newState );
|
||||||
@ -1310,12 +1311,22 @@ void QskSkinnable::setSkinStates( QskAspect::States newStates )
|
|||||||
|
|
||||||
if ( control && control->window() )
|
if ( control && control->window() )
|
||||||
{
|
{
|
||||||
const bool needUpdate = startHintTransitions( m_data->skinStates, newStates );
|
if ( const auto skin = effectiveSkin() )
|
||||||
if ( needUpdate )
|
|
||||||
{
|
{
|
||||||
if ( control->flags() & QQuickItem::ItemHasContents )
|
const auto mask = m_data->hintTable.states() | skin->hintTable().states();
|
||||||
control->update();
|
if ( ( newStates & mask ) != ( m_data->skinStates & mask ) )
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
When there are no aspects for the changed state bits we know
|
||||||
|
that there won't be any animated transitions
|
||||||
|
*/
|
||||||
|
|
||||||
|
startHintTransitions( m_data->skinStates, newStates );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( control->flags() & QQuickItem::ItemHasContents )
|
||||||
|
control->update();
|
||||||
}
|
}
|
||||||
|
|
||||||
m_data->skinStates = newStates;
|
m_data->skinStates = newStates;
|
||||||
@ -1324,22 +1335,6 @@ void QskSkinnable::setSkinStates( QskAspect::States newStates )
|
|||||||
bool QskSkinnable::startHintTransitions(
|
bool QskSkinnable::startHintTransitions(
|
||||||
QskAspect::States oldStates, QskAspect::States newStates )
|
QskAspect::States oldStates, QskAspect::States newStates )
|
||||||
{
|
{
|
||||||
const auto skin = effectiveSkin();
|
|
||||||
auto control = owningControl();
|
|
||||||
|
|
||||||
if ( skin == nullptr || control == nullptr || control->window() == nullptr )
|
|
||||||
return false;
|
|
||||||
|
|
||||||
const auto mask = m_data->hintTable.states() | skin->hintTable().states();
|
|
||||||
if ( ( newStates & mask ) == ( oldStates & mask ) )
|
|
||||||
{
|
|
||||||
/*
|
|
||||||
When there are no aspects for the changed state bits we know
|
|
||||||
that there won't be any animated transitions
|
|
||||||
*/
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( !isTransitionAccepted( QskAspect() ) )
|
if ( !isTransitionAccepted( QskAspect() ) )
|
||||||
{
|
{
|
||||||
// the control does not like any animated transition at the moment
|
// the control does not like any animated transition at the moment
|
||||||
@ -1352,6 +1347,9 @@ bool QskSkinnable::startHintTransitions(
|
|||||||
aspect.setPlacement( effectivePlacement() );
|
aspect.setPlacement( effectivePlacement() );
|
||||||
aspect.setSection( section() );
|
aspect.setSection( section() );
|
||||||
|
|
||||||
|
const auto skin = effectiveSkin();
|
||||||
|
const auto control = owningControl();
|
||||||
|
|
||||||
const auto primitiveCount = QskAspect::primitiveCount();
|
const auto primitiveCount = QskAspect::primitiveCount();
|
||||||
|
|
||||||
const auto subControls = control->subControls();
|
const auto subControls = control->subControls();
|
||||||
@ -1379,7 +1377,7 @@ bool QskSkinnable::startHintTransitions(
|
|||||||
const auto primitive = static_cast< QskAspect::Primitive >( i );
|
const auto primitive = static_cast< QskAspect::Primitive >( i );
|
||||||
aspect.setPrimitive( type, primitive );
|
aspect.setPrimitive( type, primitive );
|
||||||
|
|
||||||
const auto a1 = aspect | m_data->skinStates;
|
const auto a1 = aspect | oldStates;
|
||||||
const auto a2 = aspect | newStates;
|
const auto a2 = aspect | newStates;
|
||||||
|
|
||||||
bool doTransition = true;
|
bool doTransition = true;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user