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