QskSkinnable::subcontrolProxy added
This commit is contained in:
parent
d947920abe
commit
3606f61c65
|
@ -13,17 +13,20 @@
|
||||||
|
|
||||||
QSK_SUBCONTROL( ButtonBar, Indicator )
|
QSK_SUBCONTROL( ButtonBar, Indicator )
|
||||||
|
|
||||||
class IndicatorLabel final : public QskGraphicLabel
|
namespace
|
||||||
{
|
{
|
||||||
public:
|
class IndicatorLabel final : public QskGraphicLabel
|
||||||
IndicatorLabel( QQuickItem* parentItem = nullptr )
|
|
||||||
: QskGraphicLabel( parentItem )
|
|
||||||
{
|
{
|
||||||
// so the skins are able to colorize them
|
public:
|
||||||
setGraphicRole( SkinFactory::Indicator );
|
IndicatorLabel( QQuickItem* parentItem = nullptr )
|
||||||
setSubcontrolProxy( QskGraphicLabel::Graphic, ButtonBar::Indicator );
|
: QskGraphicLabel( parentItem )
|
||||||
}
|
{
|
||||||
};
|
// so the skins are able to colorize them
|
||||||
|
setGraphicRole( SkinFactory::Indicator );
|
||||||
|
setSubcontrolProxy( QskGraphicLabel::Graphic, ButtonBar::Indicator );
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
ButtonBar::ButtonBar( QQuickItem* parentItem )
|
ButtonBar::ButtonBar( QQuickItem* parentItem )
|
||||||
: QskLinearBox( parentItem )
|
: QskLinearBox( parentItem )
|
||||||
|
|
|
@ -15,25 +15,13 @@ Box::Box( const QString& title, QQuickItem* parent )
|
||||||
{
|
{
|
||||||
setAutoAddChildren( true );
|
setAutoAddChildren( true );
|
||||||
setAutoLayoutChildren( true );
|
setAutoLayoutChildren( true );
|
||||||
|
|
||||||
setPanel( true );
|
setPanel( true );
|
||||||
|
setSubcontrolProxy( QskBox::Panel, Box::Panel );
|
||||||
|
|
||||||
auto label = new QskTextLabel( title, this );
|
auto label = new QskTextLabel( title, this );
|
||||||
label->setFontRole( Skin::TitleFont );
|
label->setFontRole( Skin::TitleFont );
|
||||||
|
label->setVisible( !tite.isEmpty() );
|
||||||
if( label->text().isEmpty() )
|
|
||||||
{
|
|
||||||
label->setVisible( false );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
QskAspect::Subcontrol Box::substitutedSubcontrol( QskAspect::Subcontrol subControl ) const
|
|
||||||
{
|
|
||||||
if( subControl == QskBox::Panel )
|
|
||||||
{
|
|
||||||
return Box::Panel;
|
|
||||||
}
|
|
||||||
|
|
||||||
return subControl;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#include "moc_Box.cpp"
|
#include "moc_Box.cpp"
|
||||||
|
|
|
@ -17,9 +17,4 @@ class Box : public QskLinearBox
|
||||||
QSK_SUBCONTROLS( Panel )
|
QSK_SUBCONTROLS( Panel )
|
||||||
|
|
||||||
Box( const QString& title, QQuickItem* parent = nullptr );
|
Box( const QString& title, QQuickItem* parent = nullptr );
|
||||||
|
|
||||||
protected:
|
|
||||||
|
|
||||||
QskAspect::Subcontrol substitutedSubcontrol(
|
|
||||||
QskAspect::Subcontrol ) const override;
|
|
||||||
};
|
};
|
||||||
|
|
|
@ -27,7 +27,7 @@ BoxWithButtons::BoxWithButtons( const QString& title, const QString& value,
|
||||||
|
|
||||||
setSizePolicy( Qt::Vertical, QskSizePolicy::Maximum );
|
setSizePolicy( Qt::Vertical, QskSizePolicy::Maximum );
|
||||||
|
|
||||||
auto layout = new QskLinearBox( Qt::Horizontal, this );
|
auto* layout = new QskLinearBox( Qt::Horizontal, this );
|
||||||
layout->setSpacing( 20 );
|
layout->setSpacing( 20 );
|
||||||
|
|
||||||
QString iconFile = title.toLower();
|
QString iconFile = title.toLower();
|
||||||
|
|
|
@ -217,7 +217,6 @@ class QskSkinnable::PrivateData
|
||||||
}
|
}
|
||||||
|
|
||||||
QskSkinHintTable hintTable;
|
QskSkinHintTable hintTable;
|
||||||
|
|
||||||
QskHintAnimatorTable animators;
|
QskHintAnimatorTable animators;
|
||||||
|
|
||||||
typedef std::map< QskAspect::Subcontrol, QskAspect::Subcontrol > ProxyMap;
|
typedef std::map< QskAspect::Subcontrol, QskAspect::Subcontrol > ProxyMap;
|
||||||
|
@ -297,7 +296,7 @@ void QskSkinnable::setSubcontrolProxy(
|
||||||
if ( m_data->subcontrolProxies == nullptr )
|
if ( m_data->subcontrolProxies == nullptr )
|
||||||
m_data->subcontrolProxies = new PrivateData::ProxyMap();
|
m_data->subcontrolProxies = new PrivateData::ProxyMap();
|
||||||
|
|
||||||
(*m_data->subcontrolProxies)[ subControl ] = proxy;
|
( *m_data->subcontrolProxies )[ subControl ] = proxy;
|
||||||
}
|
}
|
||||||
|
|
||||||
void QskSkinnable::resetSubcontrolProxy( QskAspect::Subcontrol subcontrol )
|
void QskSkinnable::resetSubcontrolProxy( QskAspect::Subcontrol subcontrol )
|
||||||
|
|
Loading…
Reference in New Issue