symbolHints introduced, several skinlets changed to make use of them
This commit is contained in:
parent
a32204cd8c
commit
c587263592
|
@ -119,8 +119,10 @@ namespace
|
||||||
class Editor : private QskSkinHintTableEditor
|
class Editor : private QskSkinHintTableEditor
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Editor( QskSkinHintTable* table, const QskMaterial3Theme& palette )
|
Editor( const QskSkin* skin, QskSkinHintTable* table,
|
||||||
|
const QskMaterial3Theme& palette )
|
||||||
: QskSkinHintTableEditor( table )
|
: QskSkinHintTableEditor( table )
|
||||||
|
, m_skin( skin )
|
||||||
, m_pal( palette )
|
, m_pal( palette )
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
@ -128,6 +130,8 @@ namespace
|
||||||
void setup();
|
void setup();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
QskGraphic symbol( int type ) const { return m_skin->symbol( type ); }
|
||||||
|
|
||||||
void setupBox();
|
void setupBox();
|
||||||
void setupCheckBox();
|
void setupCheckBox();
|
||||||
void setupComboBox();
|
void setupComboBox();
|
||||||
|
@ -155,6 +159,7 @@ namespace
|
||||||
void setupTextInput();
|
void setupTextInput();
|
||||||
void setupTextLabel();
|
void setupTextLabel();
|
||||||
|
|
||||||
|
const QskSkin* m_skin;
|
||||||
const QskMaterial3Theme& m_pal;
|
const QskMaterial3Theme& m_pal;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -248,6 +253,13 @@ void Editor::setupCheckBox()
|
||||||
|
|
||||||
setGraphicRole( Q::Indicator | Q::Error, QskMaterial3Skin::GraphicRoleOnError );
|
setGraphicRole( Q::Indicator | Q::Error, QskMaterial3Skin::GraphicRoleOnError );
|
||||||
|
|
||||||
|
for ( auto state : { QskAspect::NoState, Q::Disabled } )
|
||||||
|
{
|
||||||
|
const auto aspect = Q::Indicator | Q::Checked | state;
|
||||||
|
setSymbol( aspect, symbol( QskStandardSymbol::CheckMark ) );
|
||||||
|
setSymbol( aspect | Q::Error, symbol( QskStandardSymbol::CheckMark ) );
|
||||||
|
}
|
||||||
|
|
||||||
setStrutSize( Q::Ripple, 40_dp, 40_dp );
|
setStrutSize( Q::Ripple, 40_dp, 40_dp );
|
||||||
setBoxShape( Q::Ripple, 100, Qt::RelativeSize );
|
setBoxShape( Q::Ripple, 100, Qt::RelativeSize );
|
||||||
setGradient( Q::Ripple, Qt::transparent );
|
setGradient( Q::Ripple, Qt::transparent );
|
||||||
|
@ -333,6 +345,12 @@ void Editor::setupComboBox()
|
||||||
setColor( Q::Text | Q::Disabled, m_pal.onSurface38 );
|
setColor( Q::Text | Q::Disabled, m_pal.onSurface38 );
|
||||||
|
|
||||||
setGraphicRole( Q::OpenMenuGraphic, QskMaterial3Skin::GraphicRoleOnSurface38 );
|
setGraphicRole( Q::OpenMenuGraphic, QskMaterial3Skin::GraphicRoleOnSurface38 );
|
||||||
|
|
||||||
|
setSymbol( Q::OpenMenuGraphic,
|
||||||
|
symbol( QskStandardSymbol::TriangleDown ) );
|
||||||
|
|
||||||
|
setSymbol( Q::OpenMenuGraphic | Q::PopupOpen,
|
||||||
|
symbol( QskStandardSymbol::TriangleUp ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
void Editor::setupBox()
|
void Editor::setupBox()
|
||||||
|
@ -903,6 +921,9 @@ void Editor::setupSpinBox()
|
||||||
setGradient( Q::UpPanel | Q::Increasing, focusColor );
|
setGradient( Q::UpPanel | Q::Increasing, focusColor );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
setSymbol( Q::UpIndicator, symbol( QskStandardSymbol::TriangleUp ) );
|
||||||
|
setSymbol( Q::DownIndicator, symbol( QskStandardSymbol::TriangleDown ) );
|
||||||
|
|
||||||
for( const auto subControl : { Q::DownIndicator, Q::UpIndicator } )
|
for( const auto subControl : { Q::DownIndicator, Q::UpIndicator } )
|
||||||
{
|
{
|
||||||
setAlignment( subControl, Qt::AlignCenter );
|
setAlignment( subControl, Qt::AlignCenter );
|
||||||
|
@ -1346,7 +1367,7 @@ QskMaterial3Skin::QskMaterial3Skin( const QskMaterial3Theme& palette, QObject* p
|
||||||
setupFonts();
|
setupFonts();
|
||||||
setupGraphicFilters( palette );
|
setupGraphicFilters( palette );
|
||||||
|
|
||||||
Editor editor( &hintTable(), palette );
|
Editor editor( this, &hintTable(), palette );
|
||||||
editor.setup();
|
editor.setup();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1356,24 +1377,19 @@ QskMaterial3Skin::~QskMaterial3Skin()
|
||||||
|
|
||||||
QskGraphic QskMaterial3Skin::symbol( int symbolType ) const
|
QskGraphic QskMaterial3Skin::symbol( int symbolType ) const
|
||||||
{
|
{
|
||||||
const auto* provider = graphicProvider( {} );
|
const auto provider = graphicProvider( {} );
|
||||||
|
|
||||||
switch ( symbolType )
|
switch ( symbolType )
|
||||||
{
|
{
|
||||||
case QskStandardSymbol::CheckMark:
|
case QskStandardSymbol::CheckMark:
|
||||||
return *( provider->requestGraphic( "check_small" ) );
|
return *( provider->requestGraphic( "check_small" ) );
|
||||||
|
|
||||||
case QskStandardSymbol::CrossMark:
|
|
||||||
return {};
|
|
||||||
|
|
||||||
case QskStandardSymbol::SegmentedBarCheckMark:
|
case QskStandardSymbol::SegmentedBarCheckMark:
|
||||||
return *( provider->requestGraphic( "segmented-button-check" ) );
|
return *( provider->requestGraphic( "segmented-button-check" ) );
|
||||||
|
|
||||||
case QskStandardSymbol::ComboBoxSymbolPopupClosed:
|
|
||||||
case QskStandardSymbol::TriangleDown:
|
case QskStandardSymbol::TriangleDown:
|
||||||
return *( provider->requestGraphic( "combo-box-arrow-closed" ) );
|
return *( provider->requestGraphic( "combo-box-arrow-closed" ) );
|
||||||
|
|
||||||
case QskStandardSymbol::ComboBoxSymbolPopupOpen:
|
|
||||||
case QskStandardSymbol::TriangleUp:
|
case QskStandardSymbol::TriangleUp:
|
||||||
return *( provider->requestGraphic( "combo-box-arrow-open" ) );
|
return *( provider->requestGraphic( "combo-box-arrow-open" ) );
|
||||||
|
|
||||||
|
|
|
@ -45,6 +45,8 @@
|
||||||
#include <QskNamespace.h>
|
#include <QskNamespace.h>
|
||||||
#include <QskRgbValue.h>
|
#include <QskRgbValue.h>
|
||||||
#include <QskColorFilter.h>
|
#include <QskColorFilter.h>
|
||||||
|
#include <QskGraphic.h>
|
||||||
|
#include <QskStandardSymbol.h>
|
||||||
|
|
||||||
static const int qskDuration = 200;
|
static const int qskDuration = 200;
|
||||||
|
|
||||||
|
@ -323,8 +325,12 @@ void Editor::setupCheckBox()
|
||||||
setGradient( Q::Box | Q::Disabled, m_pal.lighter110 );
|
setGradient( Q::Box | Q::Disabled, m_pal.lighter110 );
|
||||||
setBoxBorderColors( Q::Box, m_pal.theme );
|
setBoxBorderColors( Q::Box, m_pal.theme );
|
||||||
|
|
||||||
setColor( Q::Indicator, m_pal.darker200 );
|
for ( auto state : { A::NoState, Q::Disabled } )
|
||||||
setColor( Q::Indicator | Q::Checked, m_pal.lighter135 );
|
{
|
||||||
|
const auto aspect = Q::Indicator | Q::Checked | state;
|
||||||
|
setSymbol( aspect,
|
||||||
|
QskStandardSymbol::graphic( QskStandardSymbol::CheckMark ) );
|
||||||
|
}
|
||||||
|
|
||||||
setTextOptions( Q::Text, Qt::ElideMiddle, QskTextOptions::NoWrap );
|
setTextOptions( Q::Text, Qt::ElideMiddle, QskTextOptions::NoWrap );
|
||||||
|
|
||||||
|
@ -1060,6 +1066,12 @@ void Editor::setupSpinBox()
|
||||||
setAnimation( subControl | A::Color, 100 );
|
setAnimation( subControl | A::Color, 100 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
setSymbol( Q::UpIndicator,
|
||||||
|
QskStandardSymbol::graphic( QskStandardSymbol::TriangleUp ) );
|
||||||
|
|
||||||
|
setSymbol( Q::DownIndicator,
|
||||||
|
QskStandardSymbol::graphic( QskStandardSymbol::TriangleDown ) );
|
||||||
|
|
||||||
for ( auto subControl : { Q::UpIndicator, Q::DownIndicator } )
|
for ( auto subControl : { Q::UpIndicator, Q::DownIndicator } )
|
||||||
{
|
{
|
||||||
setGraphicRole( subControl | Q::Disabled, DisabledColor );
|
setGraphicRole( subControl | Q::Disabled, DisabledColor );
|
||||||
|
|
|
@ -54,6 +54,8 @@ class QSK_EXPORT QskAspect
|
||||||
GraphicRole,
|
GraphicRole,
|
||||||
FontRole,
|
FontRole,
|
||||||
|
|
||||||
|
Symbol,
|
||||||
|
|
||||||
TextColor,
|
TextColor,
|
||||||
StyleColor,
|
StyleColor,
|
||||||
LinkColor,
|
LinkColor,
|
||||||
|
|
|
@ -7,10 +7,6 @@
|
||||||
#include "QskCheckBox.h"
|
#include "QskCheckBox.h"
|
||||||
#include "QskTextOptions.h"
|
#include "QskTextOptions.h"
|
||||||
#include "QskFunctions.h"
|
#include "QskFunctions.h"
|
||||||
#include "QskGraphic.h"
|
|
||||||
#include "QskStandardSymbol.h"
|
|
||||||
#include "QskColorFilter.h"
|
|
||||||
#include "QskSkin.h"
|
|
||||||
|
|
||||||
QskCheckBoxSkinlet::QskCheckBoxSkinlet( QskSkin* skin )
|
QskCheckBoxSkinlet::QskCheckBoxSkinlet( QskSkin* skin )
|
||||||
: QskSkinlet( skin )
|
: QskSkinlet( skin )
|
||||||
|
@ -25,32 +21,27 @@ QskCheckBoxSkinlet::~QskCheckBoxSkinlet()
|
||||||
QRectF QskCheckBoxSkinlet::subControlRect( const QskSkinnable* skinnable,
|
QRectF QskCheckBoxSkinlet::subControlRect( const QskSkinnable* skinnable,
|
||||||
const QRectF& contentsRect, QskAspect::Subcontrol subControl ) const
|
const QRectF& contentsRect, QskAspect::Subcontrol subControl ) const
|
||||||
{
|
{
|
||||||
|
using Q = QskCheckBox;
|
||||||
|
|
||||||
const auto checkBox = static_cast< const QskCheckBox* >( skinnable );
|
const auto checkBox = static_cast< const QskCheckBox* >( skinnable );
|
||||||
|
|
||||||
if ( subControl == QskCheckBox::Panel )
|
if ( subControl == Q::Panel )
|
||||||
{
|
|
||||||
return contentsRect;
|
return contentsRect;
|
||||||
}
|
|
||||||
else if ( subControl == QskCheckBox::Box )
|
if ( subControl == Q::Box )
|
||||||
{
|
|
||||||
return boxRect( checkBox, contentsRect );
|
return boxRect( checkBox, contentsRect );
|
||||||
}
|
|
||||||
else if ( subControl == QskCheckBox::Indicator )
|
|
||||||
{
|
|
||||||
const auto boxRect = subControlRect( skinnable, contentsRect, QskCheckBox::Box );
|
|
||||||
return skinnable->innerBox( QskCheckBox::Box, boxRect );
|
|
||||||
|
|
||||||
return skinnable->innerBox( QskCheckBox::Box, contentsRect );
|
if ( subControl == Q::Indicator )
|
||||||
}
|
|
||||||
else if ( subControl == QskCheckBox::Text )
|
|
||||||
{
|
{
|
||||||
|
const auto boxRect = subControlRect( skinnable, contentsRect, Q::Box );
|
||||||
|
return skinnable->innerBox( Q::Box, boxRect );
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( subControl == Q::Text )
|
||||||
return textRect( checkBox, contentsRect );
|
return textRect( checkBox, contentsRect );
|
||||||
}
|
|
||||||
|
|
||||||
if ( subControl == QskCheckBox::Ripple )
|
if ( subControl == Q::Ripple )
|
||||||
{
|
|
||||||
return rippleRect( checkBox, contentsRect );
|
return rippleRect( checkBox, contentsRect );
|
||||||
}
|
|
||||||
|
|
||||||
return contentsRect;
|
return contentsRect;
|
||||||
}
|
}
|
||||||
|
@ -58,11 +49,13 @@ QRectF QskCheckBoxSkinlet::subControlRect( const QskSkinnable* skinnable,
|
||||||
QRectF QskCheckBoxSkinlet::textRect(
|
QRectF QskCheckBoxSkinlet::textRect(
|
||||||
const QskCheckBox* checkBox, const QRectF& contentsRect ) const
|
const QskCheckBox* checkBox, const QRectF& contentsRect ) const
|
||||||
{
|
{
|
||||||
const auto boxRect = subControlRect( checkBox, contentsRect, QskCheckBox::Box );
|
using Q = QskCheckBox;
|
||||||
const qreal spacing = checkBox->spacingHint( QskCheckBox::Panel );
|
|
||||||
|
|
||||||
auto r = subControlRect( checkBox, contentsRect, QskCheckBox::Panel );
|
const auto boxRect = subControlRect( checkBox, contentsRect, Q::Box );
|
||||||
r = checkBox->innerBox( QskCheckBox::Panel, r );
|
const qreal spacing = checkBox->spacingHint( Q::Panel );
|
||||||
|
|
||||||
|
auto r = subControlRect( checkBox, contentsRect, Q::Panel );
|
||||||
|
r = checkBox->innerBox( Q::Panel, r );
|
||||||
|
|
||||||
if ( checkBox->layoutMirroring() )
|
if ( checkBox->layoutMirroring() )
|
||||||
r.setRight( boxRect.left() - spacing );
|
r.setRight( boxRect.left() - spacing );
|
||||||
|
@ -108,58 +101,42 @@ QRectF QskCheckBoxSkinlet::rippleRect(
|
||||||
QSGNode* QskCheckBoxSkinlet::updateSubNode(
|
QSGNode* QskCheckBoxSkinlet::updateSubNode(
|
||||||
const QskSkinnable* skinnable, quint8 nodeRole, QSGNode* node ) const
|
const QskSkinnable* skinnable, quint8 nodeRole, QSGNode* node ) const
|
||||||
{
|
{
|
||||||
|
using Q = QskCheckBox;
|
||||||
|
|
||||||
auto checkBox = static_cast< const QskCheckBox* >( skinnable );
|
auto checkBox = static_cast< const QskCheckBox* >( skinnable );
|
||||||
|
|
||||||
switch( nodeRole )
|
switch( nodeRole )
|
||||||
{
|
{
|
||||||
case PanelRole:
|
case PanelRole:
|
||||||
return updateBoxNode( skinnable, node, QskCheckBox::Panel );
|
return updateBoxNode( skinnable, node, Q::Panel );
|
||||||
|
|
||||||
case BoxRole:
|
case BoxRole:
|
||||||
return updateBoxNode( skinnable, node, QskCheckBox::Box );
|
return updateBoxNode( skinnable, node, Q::Box );
|
||||||
|
|
||||||
case IndicatorRole:
|
case IndicatorRole:
|
||||||
return updateIndicatorNode( checkBox, node );
|
return updateSymbolNode( checkBox, node, Q::Indicator );
|
||||||
|
|
||||||
case TextRole:
|
case TextRole:
|
||||||
return updateTextNode( checkBox, node );
|
return updateTextNode( checkBox, node );
|
||||||
|
|
||||||
case RippleRole:
|
case RippleRole:
|
||||||
{
|
return updateBoxNode( checkBox, node, Q::Ripple );
|
||||||
return updateBoxNode( checkBox, node, QskCheckBox::Ripple );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return Inherited::updateSubNode( skinnable, nodeRole, node );
|
return Inherited::updateSubNode( skinnable, nodeRole, node );
|
||||||
}
|
}
|
||||||
|
|
||||||
QSGNode* QskCheckBoxSkinlet::updateIndicatorNode(
|
|
||||||
const QskCheckBox* checkBox, QSGNode* node ) const
|
|
||||||
{
|
|
||||||
auto symbol = QskStandardSymbol::CheckMark;
|
|
||||||
if ( !checkBox->isChecked() )
|
|
||||||
{
|
|
||||||
#if 0
|
|
||||||
symbol = QskStandardSymbol::NoSymbol;
|
|
||||||
#else
|
|
||||||
symbol = QskStandardSymbol::CrossMark;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
auto graphic = checkBox->effectiveSkin()->symbol( symbol );
|
|
||||||
return updateGraphicNode( checkBox, node, graphic, QskCheckBox::Indicator );
|
|
||||||
}
|
|
||||||
|
|
||||||
QSGNode* QskCheckBoxSkinlet::updateTextNode(
|
QSGNode* QskCheckBoxSkinlet::updateTextNode(
|
||||||
const QskCheckBox* checkBox, QSGNode* node ) const
|
const QskCheckBox* checkBox, QSGNode* node ) const
|
||||||
{
|
{
|
||||||
using Q = QskCheckBox;
|
using Q = QskCheckBox;
|
||||||
|
|
||||||
const auto rect = checkBox->subControlRect( Q::Text );
|
const auto rect = checkBox->subControlRect( Q::Text );
|
||||||
const auto alignH = checkBox->layoutMirroring() ? Qt::AlignRight : Qt::AlignLeft;
|
const auto alignH = checkBox->layoutMirroring()
|
||||||
|
? Qt::AlignRight : Qt::AlignLeft;
|
||||||
|
|
||||||
return QskSkinlet::updateTextNode( checkBox, node, rect, alignH | Qt::AlignVCenter,
|
return QskSkinlet::updateTextNode( checkBox, node,
|
||||||
checkBox->text(), QskCheckBox::Text );
|
rect, alignH | Qt::AlignVCenter, checkBox->text(), Q::Text );
|
||||||
}
|
}
|
||||||
|
|
||||||
QSizeF QskCheckBoxSkinlet::sizeHint( const QskSkinnable* skinnable,
|
QSizeF QskCheckBoxSkinlet::sizeHint( const QskSkinnable* skinnable,
|
||||||
|
|
|
@ -46,7 +46,6 @@ class QSK_EXPORT QskCheckBoxSkinlet : public QskSkinlet
|
||||||
QRectF boxRect( const QskCheckBox*, const QRectF& ) const;
|
QRectF boxRect( const QskCheckBox*, const QRectF& ) const;
|
||||||
QRectF rippleRect( const QskCheckBox*, const QRectF& ) const;
|
QRectF rippleRect( const QskCheckBox*, const QRectF& ) const;
|
||||||
|
|
||||||
QSGNode* updateIndicatorNode( const QskCheckBox*, QSGNode* ) const;
|
|
||||||
QSGNode* updateTextNode( const QskCheckBox*, QSGNode* ) const;
|
QSGNode* updateTextNode( const QskCheckBox*, QSGNode* ) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -7,9 +7,7 @@
|
||||||
#include "QskComboBox.h"
|
#include "QskComboBox.h"
|
||||||
|
|
||||||
#include "QskGraphic.h"
|
#include "QskGraphic.h"
|
||||||
#include "QskSkin.h"
|
|
||||||
#include "QskSGNode.h"
|
#include "QskSGNode.h"
|
||||||
#include "QskStandardSymbol.h"
|
|
||||||
#include "QskSubcontrolLayoutEngine.h"
|
#include "QskSubcontrolLayoutEngine.h"
|
||||||
|
|
||||||
namespace
|
namespace
|
||||||
|
@ -116,29 +114,16 @@ QSGNode* QskComboBoxSkinlet::updateSubNode(
|
||||||
switch ( nodeRole )
|
switch ( nodeRole )
|
||||||
{
|
{
|
||||||
case PanelRole:
|
case PanelRole:
|
||||||
{
|
|
||||||
return updateBoxNode( box, node, Q::Panel );
|
return updateBoxNode( box, node, Q::Panel );
|
||||||
}
|
|
||||||
|
|
||||||
case GraphicRole:
|
case GraphicRole:
|
||||||
{
|
|
||||||
return updateGraphicNode( box, node, box->graphic(), Q::Graphic );
|
return updateGraphicNode( box, node, box->graphic(), Q::Graphic );
|
||||||
}
|
|
||||||
|
|
||||||
case TextRole:
|
case TextRole:
|
||||||
{
|
|
||||||
return updateTextNode( box, node );
|
return updateTextNode( box, node );
|
||||||
}
|
|
||||||
|
|
||||||
case OpenMenuGraphicRole:
|
case OpenMenuGraphicRole:
|
||||||
{
|
return updateSymbolNode( box, node, Q::OpenMenuGraphic );
|
||||||
const auto symbol = box->isPopupOpen()
|
|
||||||
? QskStandardSymbol::ComboBoxSymbolPopupOpen
|
|
||||||
: QskStandardSymbol::ComboBoxSymbolPopupClosed;
|
|
||||||
|
|
||||||
const auto graphic = box->effectiveSkin()->symbol( symbol );
|
|
||||||
return updateGraphicNode( box, node, graphic, Q::OpenMenuGraphic );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return Inherited::updateSubNode( skinnable, nodeRole, node );
|
return Inherited::updateSubNode( skinnable, nodeRole, node );
|
||||||
|
|
|
@ -12,6 +12,7 @@
|
||||||
#include "QskBoxBorderMetrics.h"
|
#include "QskBoxBorderMetrics.h"
|
||||||
#include "QskBoxBorderColors.h"
|
#include "QskBoxBorderColors.h"
|
||||||
#include "QskShadowMetrics.h"
|
#include "QskShadowMetrics.h"
|
||||||
|
#include "QskGraphic.h"
|
||||||
|
|
||||||
namespace
|
namespace
|
||||||
{
|
{
|
||||||
|
@ -124,6 +125,11 @@ namespace
|
||||||
{
|
{
|
||||||
return aspect | QskAspect::Option;
|
return aspect | QskAspect::Option;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline QskAspect aspectSymbol( QskAspect aspect )
|
||||||
|
{
|
||||||
|
return aspect | QskAspect::Symbol;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QskSkinHintTableEditor::QskSkinHintTableEditor( QskSkinHintTable* table )
|
QskSkinHintTableEditor::QskSkinHintTableEditor( QskSkinHintTable* table )
|
||||||
|
@ -600,7 +606,7 @@ void QskSkinHintTableEditor::setTextOptions( QskAspect aspect,
|
||||||
}
|
}
|
||||||
|
|
||||||
void QskSkinHintTableEditor::setTextOptions( QskAspect aspect,
|
void QskSkinHintTableEditor::setTextOptions( QskAspect aspect,
|
||||||
const QskTextOptions& textOptions, QskStateCombination combination )
|
const QskTextOptions& textOptions, QskStateCombination combination )
|
||||||
{
|
{
|
||||||
setHint( aspectOption( aspect ), textOptions, combination );
|
setHint( aspectOption( aspect ), textOptions, combination );
|
||||||
}
|
}
|
||||||
|
@ -615,3 +621,20 @@ QskTextOptions QskSkinHintTableEditor::textOptions( QskAspect aspect ) const
|
||||||
{
|
{
|
||||||
return hint< QskTextOptions >( aspectOption( aspect ) );
|
return hint< QskTextOptions >( aspectOption( aspect ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void QskSkinHintTableEditor::setSymbol( QskAspect aspect,
|
||||||
|
const QskGraphic& symbol, QskStateCombination combination )
|
||||||
|
{
|
||||||
|
setHint( aspectSymbol( aspect ), symbol, combination );
|
||||||
|
}
|
||||||
|
|
||||||
|
bool QskSkinHintTableEditor::removeSymbol(
|
||||||
|
QskAspect aspect, QskStateCombination combination )
|
||||||
|
{
|
||||||
|
return removeHint( aspectSymbol( aspect ), combination );
|
||||||
|
}
|
||||||
|
|
||||||
|
QskGraphic QskSkinHintTableEditor::symbol( QskAspect aspect ) const
|
||||||
|
{
|
||||||
|
return hint< QskGraphic >( aspectSymbol( aspect ) );
|
||||||
|
}
|
||||||
|
|
|
@ -22,6 +22,7 @@ class QskBoxShapeMetrics;
|
||||||
class QskBoxBorderMetrics;
|
class QskBoxBorderMetrics;
|
||||||
class QskBoxBorderColors;
|
class QskBoxBorderColors;
|
||||||
class QskShadowMetrics;
|
class QskShadowMetrics;
|
||||||
|
class QskGraphic;
|
||||||
|
|
||||||
class QSK_EXPORT QskSkinHintTableEditor
|
class QSK_EXPORT QskSkinHintTableEditor
|
||||||
{
|
{
|
||||||
|
@ -275,6 +276,14 @@ class QSK_EXPORT QskSkinHintTableEditor
|
||||||
bool removeTextOptions( QskAspect, QskStateCombination = QskStateCombination() );
|
bool removeTextOptions( QskAspect, QskStateCombination = QskStateCombination() );
|
||||||
QskTextOptions textOptions( QskAspect ) const;
|
QskTextOptions textOptions( QskAspect ) const;
|
||||||
|
|
||||||
|
// symbol
|
||||||
|
|
||||||
|
void setSymbol( QskAspect,
|
||||||
|
const QskGraphic&, QskStateCombination = QskStateCombination() );
|
||||||
|
|
||||||
|
bool removeSymbol( QskAspect, QskStateCombination = QskStateCombination() );
|
||||||
|
QskGraphic symbol( QskAspect ) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QskSkinHintTable* m_table = nullptr;
|
QskSkinHintTable* m_table = nullptr;
|
||||||
};
|
};
|
||||||
|
|
|
@ -632,14 +632,22 @@ QSGNode* QskSkinlet::updateTextNode(
|
||||||
rect, alignment, text, subControl );
|
rect, alignment, text, subControl );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QSGNode* QskSkinlet::updateSymbolNode(
|
||||||
|
const QskSkinnable* skinnable, QSGNode* node,
|
||||||
|
QskAspect::Subcontrol subControl ) const
|
||||||
|
{
|
||||||
|
return updateGraphicNode( skinnable, node,
|
||||||
|
skinnable->symbolHint( subControl ), subControl );
|
||||||
|
}
|
||||||
|
|
||||||
QSGNode* QskSkinlet::updateGraphicNode(
|
QSGNode* QskSkinlet::updateGraphicNode(
|
||||||
const QskSkinnable* skinnable, QSGNode* node,
|
const QskSkinnable* skinnable, QSGNode* node,
|
||||||
const QskGraphic& graphic, QskAspect::Subcontrol subcontrol,
|
const QskGraphic& graphic, QskAspect::Subcontrol subControl,
|
||||||
Qt::Orientations mirrored ) const
|
Qt::Orientations mirrored ) const
|
||||||
{
|
{
|
||||||
const auto rect = qskSubControlRect( this, skinnable, subcontrol );
|
const auto rect = qskSubControlRect( this, skinnable, subControl );
|
||||||
const auto alignment = skinnable->alignmentHint( subcontrol, Qt::AlignCenter );
|
const auto alignment = skinnable->alignmentHint( subControl, Qt::AlignCenter );
|
||||||
const auto colorFilter = skinnable->effectiveGraphicFilter( subcontrol );
|
const auto colorFilter = skinnable->effectiveGraphicFilter( subControl );
|
||||||
|
|
||||||
return updateGraphicNode( skinnable, node,
|
return updateGraphicNode( skinnable, node,
|
||||||
graphic, colorFilter, rect, alignment, mirrored );
|
graphic, colorFilter, rect, alignment, mirrored );
|
||||||
|
|
|
@ -159,6 +159,9 @@ class QSK_EXPORT QskSkinlet
|
||||||
QSGNode* updateTextNode( const QskSkinnable*, QSGNode*,
|
QSGNode* updateTextNode( const QskSkinnable*, QSGNode*,
|
||||||
const QString&, QskAspect::Subcontrol ) const;
|
const QString&, QskAspect::Subcontrol ) const;
|
||||||
|
|
||||||
|
QSGNode* updateSymbolNode( const QskSkinnable*, QSGNode*,
|
||||||
|
QskAspect::Subcontrol ) const;
|
||||||
|
|
||||||
QSGNode* updateGraphicNode( const QskSkinnable*, QSGNode*,
|
QSGNode* updateGraphicNode( const QskSkinnable*, QSGNode*,
|
||||||
const QskGraphic&, QskAspect::Subcontrol,
|
const QskGraphic&, QskAspect::Subcontrol,
|
||||||
Qt::Orientations mirrored = Qt::Orientations() ) const;
|
Qt::Orientations mirrored = Qt::Orientations() ) const;
|
||||||
|
|
|
@ -26,6 +26,7 @@
|
||||||
#include "QskBoxHints.h"
|
#include "QskBoxHints.h"
|
||||||
#include "QskGradient.h"
|
#include "QskGradient.h"
|
||||||
#include "QskTextOptions.h"
|
#include "QskTextOptions.h"
|
||||||
|
#include "QskGraphic.h"
|
||||||
|
|
||||||
#include <qfont.h>
|
#include <qfont.h>
|
||||||
#include <qfontmetrics.h>
|
#include <qfontmetrics.h>
|
||||||
|
@ -650,7 +651,7 @@ qreal QskSkinnable::spacingHint(
|
||||||
bool QskSkinnable::setTextOptionsHint(
|
bool QskSkinnable::setTextOptionsHint(
|
||||||
const QskAspect aspect, const QskTextOptions& options )
|
const QskAspect aspect, const QskTextOptions& options )
|
||||||
{
|
{
|
||||||
return setSkinHint( aspect | QskAspect::NoType | QskAspect::Option,
|
return setSkinHint( aspect | QskAspect::Option,
|
||||||
QVariant::fromValue( options ) );
|
QVariant::fromValue( options ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -663,7 +664,7 @@ QskTextOptions QskSkinnable::textOptionsHint(
|
||||||
const QskAspect aspect, QskSkinHintStatus* status ) const
|
const QskAspect aspect, QskSkinHintStatus* status ) const
|
||||||
{
|
{
|
||||||
return effectiveSkinHint(
|
return effectiveSkinHint(
|
||||||
aspect | QskAspect::NoType | QskAspect::Option, status ).value< QskTextOptions >();
|
aspect | QskAspect::Option, status ).value< QskTextOptions >();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool QskSkinnable::setFontRoleHint( const QskAspect aspect, int role )
|
bool QskSkinnable::setFontRoleHint( const QskAspect aspect, int role )
|
||||||
|
@ -709,6 +710,26 @@ int QskSkinnable::graphicRoleHint(
|
||||||
return qskFlag( this, aspect | QskAspect::GraphicRole, status );
|
return qskFlag( this, aspect | QskAspect::GraphicRole, status );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool QskSkinnable::setSymbolHint(
|
||||||
|
const QskAspect aspect, const QskGraphic& symbol )
|
||||||
|
{
|
||||||
|
return setSkinHint( aspect | QskAspect::Symbol,
|
||||||
|
QVariant::fromValue( symbol ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
bool QskSkinnable::resetSymbolHint( const QskAspect aspect )
|
||||||
|
{
|
||||||
|
return resetSkinHint( aspect | QskAspect::Symbol );
|
||||||
|
}
|
||||||
|
|
||||||
|
QskGraphic QskSkinnable::symbolHint(
|
||||||
|
const QskAspect aspect, QskSkinHintStatus* status ) const
|
||||||
|
{
|
||||||
|
return effectiveSkinHint(
|
||||||
|
aspect | QskAspect::Symbol, status ).value< QskGraphic >();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
QskColorFilter QskSkinnable::effectiveGraphicFilter(
|
QskColorFilter QskSkinnable::effectiveGraphicFilter(
|
||||||
const QskAspect::Subcontrol subControl ) const
|
const QskAspect::Subcontrol subControl ) const
|
||||||
{
|
{
|
||||||
|
|
|
@ -32,6 +32,7 @@ class QskShadowMetrics;
|
||||||
class QskTextOptions;
|
class QskTextOptions;
|
||||||
class QskBoxHints;
|
class QskBoxHints;
|
||||||
class QskGradient;
|
class QskGradient;
|
||||||
|
class QskGraphic;
|
||||||
|
|
||||||
class QskSkin;
|
class QskSkin;
|
||||||
class QskSkinlet;
|
class QskSkinlet;
|
||||||
|
@ -246,6 +247,10 @@ class QSK_EXPORT QskSkinnable
|
||||||
bool resetGraphicRoleHint( QskAspect );
|
bool resetGraphicRoleHint( QskAspect );
|
||||||
int graphicRoleHint( QskAspect, QskSkinHintStatus* = nullptr ) const;
|
int graphicRoleHint( QskAspect, QskSkinHintStatus* = nullptr ) const;
|
||||||
|
|
||||||
|
bool setSymbolHint( const QskAspect, const QskGraphic& );
|
||||||
|
bool resetSymbolHint( const QskAspect );
|
||||||
|
QskGraphic symbolHint( const QskAspect, QskSkinHintStatus* = nullptr ) const;
|
||||||
|
|
||||||
const QskSkinHintTable& hintTable() const;
|
const QskSkinHintTable& hintTable() const;
|
||||||
|
|
||||||
bool startHintTransitions( QskAspect::States, QskAspect::States, int index = -1 );
|
bool startHintTransitions( QskAspect::States, QskAspect::States, int index = -1 );
|
||||||
|
|
|
@ -6,10 +6,7 @@
|
||||||
#include "QskSpinBoxSkinlet.h"
|
#include "QskSpinBoxSkinlet.h"
|
||||||
#include "QskSpinBox.h"
|
#include "QskSpinBox.h"
|
||||||
#include "QskFunctions.h"
|
#include "QskFunctions.h"
|
||||||
#include "QskSkin.h"
|
|
||||||
#include "QskSkinStateChanger.h"
|
#include "QskSkinStateChanger.h"
|
||||||
#include "QskStandardSymbol.h"
|
|
||||||
#include "QskGraphic.h"
|
|
||||||
|
|
||||||
#include <qfontmetrics.h>
|
#include <qfontmetrics.h>
|
||||||
|
|
||||||
|
@ -95,19 +92,13 @@ QSGNode* QskSpinBoxSkinlet::updateSubNode(
|
||||||
case UpIndicator:
|
case UpIndicator:
|
||||||
{
|
{
|
||||||
stateChanger.setStates( qskButtonStates( skinnable, Q::UpIndicator ) );
|
stateChanger.setStates( qskButtonStates( skinnable, Q::UpIndicator ) );
|
||||||
|
return updateSymbolNode( skinnable, node, Q::UpIndicator );
|
||||||
const auto skin = skinnable->effectiveSkin();
|
|
||||||
return updateGraphicNode( skinnable, node,
|
|
||||||
skin->symbol( QskStandardSymbol::TriangleUp ), Q::UpIndicator );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
case DownIndicator:
|
case DownIndicator:
|
||||||
{
|
{
|
||||||
stateChanger.setStates( qskButtonStates( skinnable, Q::DownIndicator ) );
|
stateChanger.setStates( qskButtonStates( skinnable, Q::DownIndicator ) );
|
||||||
|
return updateSymbolNode( skinnable, node, Q::DownIndicator );
|
||||||
const auto skin = skinnable->effectiveSkin();
|
|
||||||
return updateGraphicNode( skinnable, node,
|
|
||||||
skin->symbol( QskStandardSymbol::TriangleDown ), Q::DownIndicator );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
case TextPanel:
|
case TextPanel:
|
||||||
|
|
|
@ -342,8 +342,6 @@ QskGraphic QskStandardSymbol::graphic( Type symbolType )
|
||||||
}
|
}
|
||||||
case QskStandardSymbol::NoSymbol:
|
case QskStandardSymbol::NoSymbol:
|
||||||
case QskStandardSymbol::SymbolTypeCount:
|
case QskStandardSymbol::SymbolTypeCount:
|
||||||
case QskStandardSymbol::ComboBoxSymbolPopupClosed:
|
|
||||||
case QskStandardSymbol::ComboBoxSymbolPopupOpen:
|
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,8 +31,6 @@ namespace QskStandardSymbol
|
||||||
CrossMark,
|
CrossMark,
|
||||||
|
|
||||||
SegmentedBarCheckMark,
|
SegmentedBarCheckMark,
|
||||||
ComboBoxSymbolPopupClosed,
|
|
||||||
ComboBoxSymbolPopupOpen,
|
|
||||||
|
|
||||||
Bullet,
|
Bullet,
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue