QskSkinnable::resetHint changed
This commit is contained in:
parent
8fccc35156
commit
4e438df051
@ -4,7 +4,6 @@
|
|||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
#include "QskBox.h"
|
#include "QskBox.h"
|
||||||
#include "QskSkinHintTable.h"
|
|
||||||
|
|
||||||
QSK_SUBCONTROL( QskBox, Panel )
|
QSK_SUBCONTROL( QskBox, Panel )
|
||||||
|
|
||||||
@ -72,25 +71,15 @@ void QskBox::setPadding( const QMarginsF& padding )
|
|||||||
void QskBox::resetPadding()
|
void QskBox::resetPadding()
|
||||||
{
|
{
|
||||||
using namespace QskAspect;
|
using namespace QskAspect;
|
||||||
const Aspect aspect = QskBox::Panel | Metric | Padding;
|
|
||||||
|
|
||||||
const auto oldPadding = marginsHint( aspect );
|
if ( resetHint( QskBox::Panel | Metric | Padding ) )
|
||||||
|
|
||||||
auto& table = hintTable();
|
|
||||||
if ( table.hint( aspect ).isValid() )
|
|
||||||
{
|
|
||||||
table.removeHint( aspect );
|
|
||||||
|
|
||||||
const auto padding = marginsHint( aspect );
|
|
||||||
if ( padding != oldPadding )
|
|
||||||
{
|
{
|
||||||
resetImplicitSize();
|
resetImplicitSize();
|
||||||
|
|
||||||
if ( polishOnResize() || autoLayoutChildren() )
|
if ( polishOnResize() || autoLayoutChildren() )
|
||||||
polish();
|
polish();
|
||||||
|
|
||||||
Q_EMIT paddingChanged( padding );
|
Q_EMIT paddingChanged( padding() );
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -419,9 +419,17 @@ QskAnimationHint QskSkinnable::effectiveAnimation(
|
|||||||
return hint;
|
return hint;
|
||||||
}
|
}
|
||||||
|
|
||||||
void QskSkinnable::resetHint( QskAspect::Aspect aspect )
|
bool QskSkinnable::resetHint( QskAspect::Aspect aspect )
|
||||||
{
|
{
|
||||||
m_data->hintTable.removeHint( aspect );
|
const auto value = m_data->hintTable.takeHint( aspect );
|
||||||
|
|
||||||
|
if ( value.isValid() )
|
||||||
|
{
|
||||||
|
// return true, if the value has changed
|
||||||
|
return value != storedHint( aspect );
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
QVariant QskSkinnable::effectiveHint(
|
QVariant QskSkinnable::effectiveHint(
|
||||||
@ -571,7 +579,7 @@ const QVariant& QskSkinnable::storedHint(
|
|||||||
|
|
||||||
if ( aspect.subControl() != QskAspect::Control )
|
if ( aspect.subControl() != QskAspect::Control )
|
||||||
{
|
{
|
||||||
// trying to resolve something the skin default settings
|
// trying to resolve something from the skin default settings
|
||||||
|
|
||||||
aspect.setSubControl( QskAspect::Control );
|
aspect.setSubControl( QskAspect::Control );
|
||||||
aspect.clearStates();
|
aspect.clearStates();
|
||||||
|
@ -112,7 +112,7 @@ class QSK_EXPORT QskSkinnable
|
|||||||
void setAnimation( QskAspect::Aspect, QskAnimationHint );
|
void setAnimation( QskAspect::Aspect, QskAnimationHint );
|
||||||
QskAnimationHint animation( QskAspect::Aspect, QskSkinHintStatus* = nullptr ) const;
|
QskAnimationHint animation( QskAspect::Aspect, QskSkinHintStatus* = nullptr ) const;
|
||||||
|
|
||||||
void resetHint( QskAspect::Aspect );
|
bool resetHint( QskAspect::Aspect );
|
||||||
|
|
||||||
QskAnimationHint effectiveAnimation( QskAspect::Type, QskAspect::Subcontrol,
|
QskAnimationHint effectiveAnimation( QskAspect::Type, QskAspect::Subcontrol,
|
||||||
QskAspect::State, QskSkinHintStatus* status = nullptr ) const;
|
QskAspect::State, QskSkinHintStatus* status = nullptr ) const;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user