Squashed commit of the following:
commit f429d3ab4e82ab06bfd40577aef8e2d5fdfd59fd Author: Uwe Rathmann <Uwe.Rathmann@tigertal.de> Date: Wed Aug 4 14:40:36 2021 +0200 subcontrolProxy introduced
This commit is contained in:
parent
0bfb08b20b
commit
d947920abe
@ -21,17 +21,7 @@ class IndicatorLabel final : public QskGraphicLabel
|
||||
{
|
||||
// so the skins are able to colorize them
|
||||
setGraphicRole( SkinFactory::Indicator );
|
||||
}
|
||||
|
||||
QskAspect::Subcontrol effectiveSubcontrol(
|
||||
QskAspect::Subcontrol subControl ) const override
|
||||
{
|
||||
// so that we can set specific colors in the skin
|
||||
|
||||
if ( subControl == QskGraphicLabel::Graphic )
|
||||
return ButtonBar::Indicator;
|
||||
|
||||
return subControl;
|
||||
setSubcontrolProxy( QskGraphicLabel::Graphic, ButtonBar::Indicator );
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -6,31 +6,27 @@
|
||||
#include "Box.h"
|
||||
#include "Skin.h"
|
||||
|
||||
#include <QskBoxBorderColors.h>
|
||||
#include <QskBoxBorderMetrics.h>
|
||||
#include <QskBoxShapeMetrics.h>
|
||||
#include <QskTextLabel.h>
|
||||
|
||||
QSK_SUBCONTROL( Box, Panel )
|
||||
|
||||
Box::Box( const QString& title, QQuickItem* parent )
|
||||
: QskLinearBox( Qt::Vertical, parent )
|
||||
, m_title( title )
|
||||
, m_label( new QskTextLabel( m_title, this ) )
|
||||
{
|
||||
setAutoAddChildren( true );
|
||||
setAutoLayoutChildren( true );
|
||||
setPanel( true );
|
||||
|
||||
m_label->setFontRole( Skin::TitleFont );
|
||||
auto label = new QskTextLabel( title, this );
|
||||
label->setFontRole( Skin::TitleFont );
|
||||
|
||||
if( m_label->text().isEmpty() )
|
||||
if( label->text().isEmpty() )
|
||||
{
|
||||
m_label->setVisible( false );
|
||||
label->setVisible( false );
|
||||
}
|
||||
}
|
||||
|
||||
QskAspect::Subcontrol Box::effectiveSubcontrol( QskAspect::Subcontrol subControl ) const
|
||||
QskAspect::Subcontrol Box::substitutedSubcontrol( QskAspect::Subcontrol subControl ) const
|
||||
{
|
||||
if( subControl == QskBox::Panel )
|
||||
{
|
||||
|
@ -16,12 +16,10 @@ class Box : public QskLinearBox
|
||||
public:
|
||||
QSK_SUBCONTROLS( Panel )
|
||||
|
||||
Box( const QString& title, QQuickItem* parent );
|
||||
Box( const QString& title, QQuickItem* parent = nullptr );
|
||||
|
||||
QskAspect::Subcontrol effectiveSubcontrol(
|
||||
QskAspect::Subcontrol subControl ) const override;
|
||||
protected:
|
||||
|
||||
private:
|
||||
QString m_title;
|
||||
QskTextLabel* m_label;
|
||||
QskAspect::Subcontrol substitutedSubcontrol(
|
||||
QskAspect::Subcontrol ) const override;
|
||||
};
|
||||
|
@ -12,21 +12,22 @@
|
||||
#include <QskTextLabel.h>
|
||||
|
||||
QSK_SUBCONTROL( ButtonValueLabel, Text )
|
||||
|
||||
QSK_SUBCONTROL( TitleAndValueBox, Panel )
|
||||
|
||||
QSK_SUBCONTROL( BoxWithButtons, Panel )
|
||||
|
||||
QSK_SUBCONTROL( IndoorTemperature, Panel )
|
||||
QSK_SUBCONTROL( Humidity, Panel )
|
||||
|
||||
BoxWithButtons::BoxWithButtons( const QString& title, const QString& value, bool isBright, QQuickItem* parent )
|
||||
: Box( "", parent )
|
||||
BoxWithButtons::BoxWithButtons( const QString& title, const QString& value,
|
||||
bool isBright, QQuickItem* parent )
|
||||
: Box( QString(), parent )
|
||||
{
|
||||
setPanel( true );
|
||||
setSubcontrolProxy( QskBox::Panel, Panel );
|
||||
|
||||
setSizePolicy( Qt::Vertical, QskSizePolicy::Maximum );
|
||||
|
||||
auto* layout = new QskLinearBox( Qt::Horizontal, this );
|
||||
auto layout = new QskLinearBox( Qt::Horizontal, this );
|
||||
layout->setSpacing( 20 );
|
||||
|
||||
QString iconFile = title.toLower();
|
||||
|
@ -21,17 +21,7 @@ class ButtonValueLabel : public QskTextLabel
|
||||
ButtonValueLabel( const QString& text, QQuickItem* parent )
|
||||
: QskTextLabel( text, parent )
|
||||
{
|
||||
}
|
||||
|
||||
QskAspect::Subcontrol effectiveSubcontrol(
|
||||
QskAspect::Subcontrol subControl ) const override final
|
||||
{
|
||||
if( subControl == QskTextLabel::Text )
|
||||
{
|
||||
return Text;
|
||||
}
|
||||
|
||||
return subControl;
|
||||
setSubcontrolProxy( QskTextLabel::Text, Text );
|
||||
}
|
||||
};
|
||||
|
||||
@ -46,17 +36,7 @@ class TitleAndValueBox : public QskLinearBox
|
||||
: QskLinearBox( orientation, parent )
|
||||
{
|
||||
setPanel( true );
|
||||
}
|
||||
|
||||
QskAspect::Subcontrol effectiveSubcontrol(
|
||||
QskAspect::Subcontrol subControl ) const override final
|
||||
{
|
||||
if( subControl == QskLinearBox::Panel )
|
||||
{
|
||||
return Panel;
|
||||
}
|
||||
|
||||
return subControl;
|
||||
setSubcontrolProxy( QskLinearBox::Panel, Panel );
|
||||
}
|
||||
};
|
||||
|
||||
@ -65,18 +45,8 @@ class BoxWithButtons : public Box
|
||||
public:
|
||||
QSK_SUBCONTROLS( Panel )
|
||||
|
||||
BoxWithButtons( const QString& title, const QString& value, bool isBright, QQuickItem* parent = nullptr );
|
||||
|
||||
QskAspect::Subcontrol effectiveSubcontrol(
|
||||
QskAspect::Subcontrol subControl ) const override
|
||||
{
|
||||
if( subControl == QskBox::Panel )
|
||||
{
|
||||
return Panel;
|
||||
}
|
||||
|
||||
return subControl;
|
||||
}
|
||||
BoxWithButtons( const QString& title, const QString& value,
|
||||
bool isBright, QQuickItem* parent = nullptr );
|
||||
};
|
||||
|
||||
class IndoorTemperature : public BoxWithButtons
|
||||
|
@ -150,6 +150,8 @@ LightDisplay::LightDisplay( QQuickItem* parent )
|
||||
, m_dimmer( new LightDimmer( gradientHint( ColdPart ), gradientHint( WarmPart ), this ) )
|
||||
, m_animator( new DimmerAnimator( this, m_dimmer ) )
|
||||
{
|
||||
setSubcontrolProxy( QskBox::Panel, LightDisplay::Panel );
|
||||
|
||||
m_leftLabel->setSizePolicy( Qt::Horizontal, QskSizePolicy::Maximum );
|
||||
m_centreLabel->setSizePolicy( Qt::Horizontal, QskSizePolicy::Maximum );
|
||||
m_centreLabel->setZ( 1 );
|
||||
@ -167,16 +169,6 @@ LightDisplay::LightDisplay( QQuickItem* parent )
|
||||
} );
|
||||
}
|
||||
|
||||
QskAspect::Subcontrol LightDisplay::effectiveSubcontrol( QskAspect::Subcontrol subControl ) const
|
||||
{
|
||||
if( subControl == QskBox::Panel )
|
||||
{
|
||||
return LightDisplay::Panel;
|
||||
}
|
||||
|
||||
return subControl;
|
||||
}
|
||||
|
||||
void LightDisplay::updateLayout()
|
||||
{
|
||||
const qreal w = width() - ( m_leftLabel->width() + m_rightLabel->width() );
|
||||
|
@ -25,17 +25,7 @@ class LightIntensityValueLabel : public QskTextLabel
|
||||
LightIntensityValueLabel( const QString& text, QQuickItem* parent )
|
||||
: QskTextLabel( text, parent )
|
||||
{
|
||||
}
|
||||
|
||||
QskAspect::Subcontrol effectiveSubcontrol(
|
||||
QskAspect::Subcontrol subControl ) const override final
|
||||
{
|
||||
if( subControl == QskTextLabel::Text )
|
||||
{
|
||||
return Text;
|
||||
}
|
||||
|
||||
return subControl;
|
||||
setSubcontrolProxy( QskTextLabel::Text, Text );
|
||||
}
|
||||
};
|
||||
|
||||
@ -44,7 +34,8 @@ class LightDimmer : public QQuickPaintedItem
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
LightDimmer( const QskGradient& coldGradient, const QskGradient& warmGradient, QQuickItem* parent );
|
||||
LightDimmer( const QskGradient& coldGradient,
|
||||
const QskGradient& warmGradient, QQuickItem* parent );
|
||||
|
||||
double thickness() const
|
||||
{
|
||||
@ -77,13 +68,13 @@ class LightDimmer : public QQuickPaintedItem
|
||||
}
|
||||
|
||||
private:
|
||||
virtual void paint( QPainter* painter ) override;
|
||||
|
||||
double m_thickness = 17.57;
|
||||
QColor m_backgroundColor;
|
||||
QRadialGradient m_ringGradient;
|
||||
QskGradient m_coldGradient;
|
||||
QskGradient m_warmGradient;
|
||||
|
||||
virtual void paint( QPainter* painter ) override;
|
||||
};
|
||||
|
||||
class LightDisplay : public QskControl
|
||||
@ -95,9 +86,6 @@ class LightDisplay : public QskControl
|
||||
|
||||
LightDisplay( QQuickItem* parent );
|
||||
|
||||
QskAspect::Subcontrol effectiveSubcontrol(
|
||||
QskAspect::Subcontrol subControl ) const override final;
|
||||
|
||||
protected:
|
||||
void updateLayout() override;
|
||||
|
||||
|
@ -85,11 +85,13 @@ void ShadowPositioner::updateLayout()
|
||||
MainContent::MainContent( QQuickItem* parent )
|
||||
: QskLinearBox( Qt::Vertical, parent )
|
||||
{
|
||||
setPanel( true );
|
||||
setSubcontrolProxy( QskBox::Panel, MainContent::Panel );
|
||||
|
||||
setAutoAddChildren( false );
|
||||
setSizePolicy( QskSizePolicy::Expanding, QskSizePolicy::Expanding );
|
||||
setDefaultAlignment( Qt::AlignTop );
|
||||
setSpacing( 24 );
|
||||
setPanel( true );
|
||||
|
||||
auto* topBar = new TopBar( this );
|
||||
addItem( topBar );
|
||||
@ -126,16 +128,6 @@ MainContent::MainContent( QQuickItem* parent )
|
||||
m_shadowPositioner->setGridBox( gridBox );
|
||||
}
|
||||
|
||||
QskAspect::Subcontrol MainContent::effectiveSubcontrol( QskAspect::Subcontrol subControl ) const
|
||||
{
|
||||
if( subControl == QskBox::Panel )
|
||||
{
|
||||
return MainContent::Panel;
|
||||
}
|
||||
|
||||
return subControl;
|
||||
}
|
||||
|
||||
void MainContent::geometryChangeEvent( QskGeometryChangeEvent* event )
|
||||
{
|
||||
QskLinearBox::geometryChangeEvent( event );
|
||||
|
@ -37,17 +37,7 @@ class MainContentGridBox : public QskGridBox
|
||||
MainContentGridBox( QQuickItem* parent = nullptr )
|
||||
: QskGridBox( parent )
|
||||
{
|
||||
}
|
||||
|
||||
QskAspect::Subcontrol effectiveSubcontrol(
|
||||
QskAspect::Subcontrol subControl ) const override final
|
||||
{
|
||||
if( subControl == QskGridBox::Panel )
|
||||
{
|
||||
return Panel;
|
||||
}
|
||||
|
||||
return subControl;
|
||||
setSubcontrolProxy( QskGridBox::Panel, Panel );
|
||||
}
|
||||
};
|
||||
|
||||
@ -60,9 +50,6 @@ class MainContent : public QskLinearBox
|
||||
|
||||
MainContent( QQuickItem* parent );
|
||||
|
||||
QskAspect::Subcontrol effectiveSubcontrol(
|
||||
QskAspect::Subcontrol subControl ) const override final;
|
||||
|
||||
protected:
|
||||
void geometryChangeEvent( QskGeometryChangeEvent* ) override;
|
||||
|
||||
|
@ -31,7 +31,9 @@ MenuItem::MenuItem( const QString& name, QQuickItem* parent )
|
||||
setSpacing( 6 );
|
||||
|
||||
setAcceptHoverEvents( true );
|
||||
|
||||
setPanel( true );
|
||||
setSubcontrolProxy( QskBox::Panel, MenuItem::Panel );
|
||||
|
||||
QString fileName = ":/images/" + name.toLower() + ".png";
|
||||
QImage image( fileName );
|
||||
@ -43,21 +45,12 @@ MenuItem::MenuItem( const QString& name, QQuickItem* parent )
|
||||
new MenuBarLabel( name, this );
|
||||
}
|
||||
|
||||
QskAspect::Subcontrol MenuItem::effectiveSubcontrol( QskAspect::Subcontrol subControl ) const
|
||||
{
|
||||
if( subControl == QskBox::Panel )
|
||||
{
|
||||
return MenuItem::Panel;
|
||||
}
|
||||
|
||||
return subControl;
|
||||
}
|
||||
|
||||
|
||||
MenuBar::MenuBar( QQuickItem* parent )
|
||||
: QskLinearBox( Qt::Vertical, parent )
|
||||
{
|
||||
setPanel( true );
|
||||
setSubcontrolProxy( QskBox::Panel, MenuBar::Panel );
|
||||
|
||||
setSizePolicy( QskSizePolicy::Minimum, QskSizePolicy::Preferred );
|
||||
setSpacing( 8 );
|
||||
|
||||
@ -83,14 +76,4 @@ MenuBar::MenuBar( QQuickItem* parent )
|
||||
new MenuItem( "Logout", this );
|
||||
}
|
||||
|
||||
QskAspect::Subcontrol MenuBar::effectiveSubcontrol( QskAspect::Subcontrol subControl ) const
|
||||
{
|
||||
if( subControl == QskBox::Panel )
|
||||
{
|
||||
return MenuBar::Panel;
|
||||
}
|
||||
|
||||
return subControl;
|
||||
}
|
||||
|
||||
#include "moc_MenuBar.cpp"
|
||||
|
@ -19,17 +19,7 @@ class MenuBarTopLabel final : public QskGraphicLabel
|
||||
MenuBarTopLabel( const QskGraphic& graphic, QQuickItem* parent = nullptr )
|
||||
: QskGraphicLabel( graphic, parent )
|
||||
{
|
||||
}
|
||||
|
||||
QskAspect::Subcontrol effectiveSubcontrol(
|
||||
QskAspect::Subcontrol subControl ) const override
|
||||
{
|
||||
if( subControl == QskGraphicLabel::Graphic )
|
||||
{
|
||||
return Graphic;
|
||||
}
|
||||
|
||||
return subControl;
|
||||
setSubcontrolProxy( QskGraphicLabel::Graphic, Graphic );
|
||||
}
|
||||
};
|
||||
|
||||
@ -43,17 +33,7 @@ class MenuBarGraphicLabel final : public QskGraphicLabel
|
||||
MenuBarGraphicLabel( const QskGraphic& graphic, QQuickItem* parent = nullptr )
|
||||
: QskGraphicLabel( graphic, parent )
|
||||
{
|
||||
}
|
||||
|
||||
QskAspect::Subcontrol effectiveSubcontrol(
|
||||
QskAspect::Subcontrol subControl ) const override
|
||||
{
|
||||
if( subControl == QskGraphicLabel::Graphic )
|
||||
{
|
||||
return Graphic;
|
||||
}
|
||||
|
||||
return subControl;
|
||||
setSubcontrolProxy( QskGraphicLabel::Graphic, Graphic );
|
||||
}
|
||||
};
|
||||
|
||||
@ -67,17 +47,7 @@ class MenuBarLabel final : public QskTextLabel
|
||||
MenuBarLabel( const QString& text, QQuickItem* parent = nullptr )
|
||||
: QskTextLabel( text, parent )
|
||||
{
|
||||
}
|
||||
|
||||
QskAspect::Subcontrol effectiveSubcontrol(
|
||||
QskAspect::Subcontrol subControl ) const override
|
||||
{
|
||||
if( subControl == QskTextLabel::Text )
|
||||
{
|
||||
return Text;
|
||||
}
|
||||
|
||||
return subControl;
|
||||
setSubcontrolProxy( QskTextLabel::Text, Text );
|
||||
}
|
||||
};
|
||||
|
||||
@ -91,8 +61,6 @@ class MenuItem final : public QskLinearBox
|
||||
|
||||
MenuItem( const QString& name, QQuickItem* parent );
|
||||
|
||||
QskAspect::Subcontrol effectiveSubcontrol( QskAspect::Subcontrol ) const override;
|
||||
|
||||
private:
|
||||
QString m_name;
|
||||
};
|
||||
@ -106,9 +74,6 @@ class MenuBar final : public QskLinearBox
|
||||
|
||||
MenuBar( QQuickItem* parent );
|
||||
|
||||
QskAspect::Subcontrol effectiveSubcontrol(
|
||||
QskAspect::Subcontrol ) const override;
|
||||
|
||||
private:
|
||||
QList< QString > m_entryStrings;
|
||||
QList< MenuItem* > m_entries;
|
||||
|
@ -88,6 +88,7 @@ PieChartPainted::PieChartPainted( const QColor& color, const QskGradient& gradie
|
||||
, m_animator( new ProgressBarAnimator( this, m_progressBar ) )
|
||||
{
|
||||
setAutoLayoutChildren( true );
|
||||
setSubcontrolProxy( QskBox::Panel, PieChartPainted::Panel );
|
||||
|
||||
auto progressText = QString::number( progress ) + " %";
|
||||
m_progressLabel->setText( progressText );
|
||||
@ -97,20 +98,8 @@ PieChartPainted::PieChartPainted( const QColor& color, const QskGradient& gradie
|
||||
const QColor c = this->color( Panel );
|
||||
m_progressBar->setBackgroundColor( c );
|
||||
|
||||
connect( qskSetup, &QskSetup::skinChanged, [this]()
|
||||
{
|
||||
m_animator->start();
|
||||
} );
|
||||
}
|
||||
|
||||
QskAspect::Subcontrol PieChartPainted::effectiveSubcontrol( QskAspect::Subcontrol subControl ) const
|
||||
{
|
||||
if( subControl == QskBox::Panel )
|
||||
{
|
||||
return PieChartPainted::Panel;
|
||||
}
|
||||
|
||||
return subControl;
|
||||
connect( qskSetup, &QskSetup::skinChanged,
|
||||
[this]() { m_animator->start(); } );
|
||||
}
|
||||
|
||||
QSizeF PieChartPainted::contentsSizeHint( Qt::SizeHint /*sizeHint*/, const QSizeF& /*size*/ ) const
|
||||
|
@ -9,9 +9,7 @@
|
||||
#include "CircularProgressBar.h"
|
||||
|
||||
class ProgressBarAnimator;
|
||||
|
||||
class QskTextLabel;
|
||||
class QQuickPaintedItem;
|
||||
|
||||
class PieChartPainted : public QskControl
|
||||
{
|
||||
@ -21,9 +19,7 @@ class PieChartPainted : public QskControl
|
||||
PieChartPainted( const QColor&, const QskGradient&,
|
||||
int progress, int value, QQuickItem* parent = nullptr );
|
||||
|
||||
QskAspect::Subcontrol effectiveSubcontrol(
|
||||
QskAspect::Subcontrol subControl ) const override final;
|
||||
|
||||
protected:
|
||||
virtual QSizeF contentsSizeHint( Qt::SizeHint, const QSizeF& ) const override;
|
||||
void updateLayout() override;
|
||||
|
||||
|
@ -19,7 +19,6 @@ QSK_STATE( RoundedIcon, Small, ( QskAspect::FirstUserState << 2 ) )
|
||||
|
||||
RoundedIcon::RoundedIcon( const QString& iconName, bool isBright, bool isSmall, QQuickItem* parent )
|
||||
: QskBox( parent )
|
||||
, m_iconName( iconName )
|
||||
{
|
||||
setPanel( true );
|
||||
setPolishOnResize( true );
|
||||
@ -48,6 +47,14 @@ RoundedIcon::RoundedIcon( const QString& iconName, bool isBright, bool isSmall,
|
||||
}
|
||||
}
|
||||
|
||||
QskAspect::Subcontrol RoundedIcon::substitutedSubcontrol( QskAspect::Subcontrol subControl ) const
|
||||
{
|
||||
if( subControl == QskBox::Panel )
|
||||
return Panel;
|
||||
|
||||
return subControl;
|
||||
}
|
||||
|
||||
void RoundedIcon::updateLayout()
|
||||
{
|
||||
if( m_graphicLabel )
|
||||
|
@ -21,22 +21,13 @@ class RoundedIcon : public QskBox
|
||||
RoundedIcon( const QString& iconName, bool isBright, bool isSmall,
|
||||
QQuickItem* parent = nullptr );
|
||||
|
||||
QskAspect::Subcontrol effectiveSubcontrol(
|
||||
QskAspect::Subcontrol subControl ) const override
|
||||
{
|
||||
if( subControl == QskBox::Panel )
|
||||
{
|
||||
return Panel;
|
||||
}
|
||||
|
||||
return subControl;
|
||||
}
|
||||
|
||||
protected:
|
||||
QskAspect::Subcontrol substitutedSubcontrol(
|
||||
QskAspect::Subcontrol ) const override;
|
||||
|
||||
void updateLayout() override;
|
||||
virtual QSizeF contentsSizeHint( Qt::SizeHint, const QSizeF& ) const override;
|
||||
|
||||
private:
|
||||
QString m_iconName;
|
||||
QskGraphicLabel* m_graphicLabel = nullptr;
|
||||
};
|
||||
|
@ -47,6 +47,8 @@ TopBarItem::TopBarItem( int index, const QString& name, const QskGradient& gradi
|
||||
: QskLinearBox( Qt::Vertical, parent )
|
||||
, m_name( name )
|
||||
{
|
||||
setSubcontrolProxy( QskLinearBox::Panel, Panel );
|
||||
|
||||
setAutoLayoutChildren( true );
|
||||
setAutoAddChildren( true );
|
||||
setSpacing( 15 );
|
||||
@ -78,6 +80,8 @@ TopBar::TopBar( QQuickItem* parent )
|
||||
: QskLinearBox( Qt::Horizontal, parent )
|
||||
{
|
||||
setPanel( true );
|
||||
setSubcontrolProxy( QskBox::Panel, Panel );
|
||||
|
||||
setAutoLayoutChildren( true );
|
||||
setAutoAddChildren( true );
|
||||
setSizePolicy( QskSizePolicy::Preferred, QskSizePolicy::Fixed );
|
||||
|
@ -20,17 +20,7 @@ class TimeTitleLabel : public QskTextLabel
|
||||
TimeTitleLabel( const QString& text, QQuickItem* parent = nullptr )
|
||||
: QskTextLabel( text, parent )
|
||||
{
|
||||
}
|
||||
|
||||
QskAspect::Subcontrol effectiveSubcontrol(
|
||||
QskAspect::Subcontrol subControl ) const override final
|
||||
{
|
||||
if( subControl == QskTextLabel::Text )
|
||||
{
|
||||
return Text;
|
||||
}
|
||||
|
||||
return subControl;
|
||||
setSubcontrolProxy( QskTextLabel::Text, Text );
|
||||
}
|
||||
};
|
||||
|
||||
@ -44,17 +34,7 @@ class TimeLabel : public QskTextLabel
|
||||
TimeLabel( const QString& text, QQuickItem* parent = nullptr )
|
||||
: QskTextLabel( text, parent )
|
||||
{
|
||||
}
|
||||
|
||||
QskAspect::Subcontrol effectiveSubcontrol(
|
||||
QskAspect::Subcontrol subControl ) const override final
|
||||
{
|
||||
if( subControl == QskTextLabel::Text )
|
||||
{
|
||||
return Text;
|
||||
}
|
||||
|
||||
return subControl;
|
||||
setSubcontrolProxy( QskTextLabel::Text, Text );
|
||||
}
|
||||
};
|
||||
|
||||
@ -65,18 +45,8 @@ class TopBarItem : public QskLinearBox
|
||||
public:
|
||||
QSK_SUBCONTROLS( Item1, Item2, Item3, Item4 )
|
||||
|
||||
TopBarItem( int index, const QString& name, const QskGradient& gradient, int progress, int value, QQuickItem* parent );
|
||||
|
||||
QskAspect::Subcontrol effectiveSubcontrol(
|
||||
QskAspect::Subcontrol subControl ) const override final
|
||||
{
|
||||
if( subControl == QskLinearBox::Panel )
|
||||
{
|
||||
return Panel;
|
||||
}
|
||||
|
||||
return subControl;
|
||||
}
|
||||
TopBarItem( int index, const QString& name, const QskGradient& gradient,
|
||||
int progress, int value, QQuickItem* parent );
|
||||
|
||||
private:
|
||||
QString m_name;
|
||||
@ -91,17 +61,6 @@ class TopBar : public QskLinearBox
|
||||
|
||||
TopBar( QQuickItem* parent );
|
||||
|
||||
QskAspect::Subcontrol effectiveSubcontrol(
|
||||
QskAspect::Subcontrol subControl ) const override final
|
||||
{
|
||||
if( subControl == QskLinearBox::Panel )
|
||||
{
|
||||
return Panel;
|
||||
}
|
||||
|
||||
return subControl;
|
||||
}
|
||||
|
||||
private:
|
||||
QList< TopBarItem* > m_entries;
|
||||
};
|
||||
|
@ -19,6 +19,7 @@ QSK_STATE( RoundButton, Top, ( QskAspect::FirstUserState << 1 ) )
|
||||
RoundButton::RoundButton( QskAspect::Placement placement, QQuickItem* parent )
|
||||
: QskPushButton( parent )
|
||||
{
|
||||
setSubcontrolProxy( QskPushButton::Panel, RoundButton::Panel );
|
||||
setSizePolicy( QskSizePolicy::Fixed, QskSizePolicy::Expanding );
|
||||
|
||||
QskGraphic graphic;
|
||||
@ -39,16 +40,6 @@ RoundButton::RoundButton( QskAspect::Placement placement, QQuickItem* parent )
|
||||
setGraphic( graphic );
|
||||
}
|
||||
|
||||
QskAspect::Subcontrol RoundButton::effectiveSubcontrol( QskAspect::Subcontrol subControl ) const
|
||||
{
|
||||
if( subControl == QskPushButton::Panel )
|
||||
{
|
||||
return RoundButton::Panel;
|
||||
}
|
||||
|
||||
return subControl;
|
||||
}
|
||||
|
||||
UpAndDownButton::UpAndDownButton( QQuickItem* parent )
|
||||
: QskLinearBox( Qt::Vertical, parent )
|
||||
{
|
||||
|
@ -17,9 +17,6 @@ class RoundButton : QskPushButton
|
||||
QSK_STATES( Top )
|
||||
|
||||
RoundButton( QskAspect::Placement placement, QQuickItem* parent );
|
||||
|
||||
QskAspect::Subcontrol effectiveSubcontrol(
|
||||
QskAspect::Subcontrol subControl ) const override final;
|
||||
};
|
||||
|
||||
class UpAndDownButton : public QskLinearBox
|
||||
|
@ -6,8 +6,6 @@
|
||||
#pragma once
|
||||
|
||||
#include "Box.h"
|
||||
|
||||
#include <QskLinearBox.h>
|
||||
#include <QskTextLabel.h>
|
||||
|
||||
class UsageSpacer : public QskTextLabel
|
||||
@ -20,17 +18,7 @@ class UsageSpacer : public QskTextLabel
|
||||
UsageSpacer( QQuickItem* parent = nullptr )
|
||||
: QskTextLabel( "_____", parent )
|
||||
{
|
||||
}
|
||||
|
||||
QskAspect::Subcontrol effectiveSubcontrol(
|
||||
QskAspect::Subcontrol subControl ) const override final
|
||||
{
|
||||
if( subControl == QskTextLabel::Text )
|
||||
{
|
||||
return Text;
|
||||
}
|
||||
|
||||
return subControl;
|
||||
setSubcontrolProxy( QskTextLabel::Text, Text );
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -67,18 +67,20 @@ CaptionItem::CaptionItem( QskAspect::State state, QQuickItem* parent )
|
||||
static constexpr int segments = 7;
|
||||
|
||||
UsageDiagram::UsageDiagram( QQuickItem* parent )
|
||||
: Box( "", parent )
|
||||
: Box( QString(), parent )
|
||||
, m_diagram( new Diagram( this ) )
|
||||
, m_weekdays( new QskGridBox( this ) )
|
||||
{
|
||||
setAutoAddChildren( false );
|
||||
setAutoLayoutChildren( true );
|
||||
|
||||
setSubcontrolProxy( QskBox::Panel, Panel );
|
||||
|
||||
int number = 100;
|
||||
|
||||
// These values are calculated with a boost::math::cubic_b_spline.
|
||||
// We just output the values here to get rid of the dependency:
|
||||
std::vector< std::vector< qreal > > yValues =
|
||||
const std::vector< std::vector< qreal > > yValues =
|
||||
{
|
||||
{64.00, 64.00, 64.00, 64.00, 64.00, 64.00, 64.00, 64.00, 64.00, 64.00, 64.00, 63.99, 63.96, 63.85, 63.64, 63.30, 62.79, 62.09, 61.14, 59.93, 58.42, 56.59, 54.50, 52.23, 49.84, 47.42, 45.03, 42.76, 40.68, 38.85, 37.36, 36.27, 35.55, 35.19, 35.14, 35.39, 35.91, 36.65, 37.60, 38.73, 40.00, 41.39, 42.87, 44.41, 46.00, 47.60, 49.19, 50.76, 52.26, 53.68, 55.00, 56.19, 57.24, 58.15, 58.90, 59.51, 59.95, 60.23, 60.33, 60.26, 60.00, 59.56, 58.94, 58.17, 57.27, 56.24, 55.12, 53.92, 52.65, 51.34, 50.00, 48.65, 47.32, 46.03, 44.79, 43.65, 42.61, 41.70, 40.95, 40.37, 40.00, 39.85, 39.94, 40.26, 40.84, 41.67, 42.77, 44.15, 45.80, 47.75, 50.00, 52.54, 55.30, 58.19, 61.13, 64.04, 66.82, 69.40, 71.67, 73.57},
|
||||
{36.00, 36.01, 36.11, 36.37, 36.88, 37.73, 38.98, 40.73, 43.07, 46.06, 49.80, 54.31, 59.38, 64.73, 70.09, 75.20, 79.77, 83.55, 86.24, 87.59, 87.33, 85.26, 81.61, 76.64, 70.67, 63.98, 56.86, 49.61, 42.52, 35.89, 30.00, 25.09, 21.14, 18.08, 15.83, 14.31, 13.45, 13.16, 13.37, 14.01, 15.00, 16.26, 17.73, 19.36, 21.07, 22.82, 24.55, 26.19, 27.68, 28.97, 30.00, 30.73, 31.25, 31.65, 32.04, 32.52, 33.21, 34.19, 35.58, 37.48, 40.00, 43.17, 46.80, 50.61, 54.33, 57.71, 60.47, 62.35, 63.07, 62.38, 60.00, 55.79, 50.12, 43.46, 36.31, 29.13, 22.43, 16.68, 12.37, 9.98, 10.00, 12.73, 17.76, 24.50, 32.36, 40.75, 49.09, 56.77, 63.21, 67.81, 70.00, 69.37, 66.28, 61.29, 54.96, 47.85, 40.51, 33.50, 27.37, 22.68},
|
||||
|
@ -25,22 +25,9 @@ class WeekdayLabel : public QskTextLabel
|
||||
: QskTextLabel( text, parent )
|
||||
{
|
||||
setPanel( true );
|
||||
}
|
||||
|
||||
QskAspect::Subcontrol effectiveSubcontrol(
|
||||
QskAspect::Subcontrol subControl ) const override final
|
||||
{
|
||||
if( subControl == QskTextLabel::Panel )
|
||||
{
|
||||
return Panel;
|
||||
}
|
||||
|
||||
if( subControl == QskTextLabel::Text )
|
||||
{
|
||||
return Text;
|
||||
}
|
||||
|
||||
return subControl;
|
||||
setSubcontrolProxy( QskTextLabel::Panel, Panel );
|
||||
setSubcontrolProxy( QskTextLabel::Text, Text );
|
||||
}
|
||||
};
|
||||
|
||||
@ -54,17 +41,7 @@ class WeekdayBox : public QskBox
|
||||
WeekdayBox( QQuickItem* parent ):
|
||||
QskBox( true, parent )
|
||||
{
|
||||
}
|
||||
|
||||
QskAspect::Subcontrol effectiveSubcontrol(
|
||||
QskAspect::Subcontrol subControl ) const override final
|
||||
{
|
||||
if( subControl == QskBox::Panel )
|
||||
{
|
||||
return WeekdayBox::Panel;
|
||||
}
|
||||
|
||||
return subControl;
|
||||
setSubcontrolProxy( QskBox::Panel, WeekdayBox::Panel );
|
||||
}
|
||||
};
|
||||
|
||||
@ -78,17 +55,7 @@ class CaptionColorBox : public QskBox
|
||||
CaptionColorBox( QQuickItem* parent ):
|
||||
QskBox( true, parent )
|
||||
{
|
||||
}
|
||||
|
||||
QskAspect::Subcontrol effectiveSubcontrol(
|
||||
QskAspect::Subcontrol subControl ) const override final
|
||||
{
|
||||
if( subControl == QskBox::Panel )
|
||||
{
|
||||
return Panel;
|
||||
}
|
||||
|
||||
return subControl;
|
||||
setSubcontrolProxy( QskBox::Panel, Panel );
|
||||
}
|
||||
};
|
||||
|
||||
@ -114,17 +81,7 @@ class CaptionBox : public QskLinearBox
|
||||
QskLinearBox( Qt::Horizontal, parent )
|
||||
{
|
||||
setPanel( true );
|
||||
}
|
||||
|
||||
QskAspect::Subcontrol effectiveSubcontrol(
|
||||
QskAspect::Subcontrol subControl ) const override final
|
||||
{
|
||||
if( subControl == QskBox::Panel )
|
||||
{
|
||||
return Panel;
|
||||
}
|
||||
|
||||
return subControl;
|
||||
setSubcontrolProxy( QskBox::Panel, Panel );
|
||||
}
|
||||
};
|
||||
|
||||
@ -137,19 +94,9 @@ class UsageDiagram : public Box
|
||||
|
||||
UsageDiagram( QQuickItem* parent );
|
||||
|
||||
protected:
|
||||
void updateLayout() override;
|
||||
|
||||
QskAspect::Subcontrol effectiveSubcontrol(
|
||||
QskAspect::Subcontrol subControl ) const override final
|
||||
{
|
||||
if( subControl == QskBox::Panel )
|
||||
{
|
||||
return Panel;
|
||||
}
|
||||
|
||||
return subControl;
|
||||
}
|
||||
|
||||
private:
|
||||
Diagram* m_diagram;
|
||||
QskLinearBox* m_captionBox;
|
||||
|
@ -23,6 +23,7 @@
|
||||
#include "QskGradient.h"
|
||||
|
||||
#include <qfont.h>
|
||||
#include <map>
|
||||
|
||||
#define DEBUG_MAP 0
|
||||
#define DEBUG_ANIMATOR 0
|
||||
@ -206,13 +207,6 @@ static inline QskAspect qskSubstitutedAspect(
|
||||
class QskSkinnable::PrivateData
|
||||
{
|
||||
public:
|
||||
PrivateData()
|
||||
: skinlet( nullptr )
|
||||
, skinState( QskAspect::NoState )
|
||||
, hasLocalSkinlet( false )
|
||||
{
|
||||
}
|
||||
|
||||
~PrivateData()
|
||||
{
|
||||
if ( hasLocalSkinlet )
|
||||
@ -223,12 +217,16 @@ class QskSkinnable::PrivateData
|
||||
}
|
||||
|
||||
QskSkinHintTable hintTable;
|
||||
|
||||
QskHintAnimatorTable animators;
|
||||
|
||||
const QskSkinlet* skinlet;
|
||||
typedef std::map< QskAspect::Subcontrol, QskAspect::Subcontrol > ProxyMap;
|
||||
ProxyMap* subcontrolProxies = nullptr;
|
||||
|
||||
QskAspect::State skinState;
|
||||
bool hasLocalSkinlet : 1;
|
||||
const QskSkinlet* skinlet = nullptr;
|
||||
|
||||
QskAspect::State skinState = QskAspect::NoState;
|
||||
bool hasLocalSkinlet = false;
|
||||
};
|
||||
|
||||
QskSkinnable::QskSkinnable()
|
||||
@ -284,6 +282,53 @@ const QskSkinlet* QskSkinnable::effectiveSkinlet() const
|
||||
return m_data->skinlet;
|
||||
}
|
||||
|
||||
void QskSkinnable::setSubcontrolProxy(
|
||||
QskAspect::Subcontrol subControl, QskAspect::Subcontrol proxy )
|
||||
{
|
||||
if ( subControl == QskAspect::Control )
|
||||
return; // nonsense, we ignore this
|
||||
|
||||
if ( proxy == QskAspect::Control || subControl == proxy )
|
||||
{
|
||||
resetSubcontrolProxy( subControl );
|
||||
return;
|
||||
}
|
||||
|
||||
if ( m_data->subcontrolProxies == nullptr )
|
||||
m_data->subcontrolProxies = new PrivateData::ProxyMap();
|
||||
|
||||
(*m_data->subcontrolProxies)[ subControl ] = proxy;
|
||||
}
|
||||
|
||||
void QskSkinnable::resetSubcontrolProxy( QskAspect::Subcontrol subcontrol )
|
||||
{
|
||||
if ( auto& proxies = m_data->subcontrolProxies )
|
||||
{
|
||||
auto it = proxies->find( subcontrol );
|
||||
if ( it != proxies->end() )
|
||||
{
|
||||
proxies->erase( it );
|
||||
if ( proxies->empty() )
|
||||
{
|
||||
delete proxies;
|
||||
proxies = nullptr;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
QskAspect::Subcontrol QskSkinnable::subcontrolProxy( QskAspect::Subcontrol subControl ) const
|
||||
{
|
||||
if ( const auto proxies = m_data->subcontrolProxies )
|
||||
{
|
||||
auto it = proxies->find( subControl );
|
||||
if ( it != proxies->end() )
|
||||
return it->second;
|
||||
}
|
||||
|
||||
return QskAspect::Control;
|
||||
}
|
||||
|
||||
QskSkinHintTable& QskSkinnable::hintTable()
|
||||
{
|
||||
return m_data->hintTable;
|
||||
@ -1162,6 +1207,19 @@ void QskSkinnable::updateNode( QSGNode* parentNode )
|
||||
|
||||
QskAspect::Subcontrol QskSkinnable::effectiveSubcontrol(
|
||||
QskAspect::Subcontrol subControl ) const
|
||||
{
|
||||
if ( const auto proxies = m_data->subcontrolProxies )
|
||||
{
|
||||
auto it = proxies->find( subControl );
|
||||
if ( it != proxies->end() )
|
||||
return it->second;
|
||||
}
|
||||
|
||||
return substitutedSubcontrol( subControl );
|
||||
}
|
||||
|
||||
QskAspect::Subcontrol QskSkinnable::substitutedSubcontrol(
|
||||
QskAspect::Subcontrol subControl ) const
|
||||
{
|
||||
// derived classes might want to redirect a sub-control
|
||||
return subControl;
|
||||
|
@ -79,6 +79,10 @@ class QSK_EXPORT QskSkinnable
|
||||
|
||||
QskColorFilter effectiveGraphicFilter( QskAspect ) const;
|
||||
|
||||
void setSubcontrolProxy( QskAspect::Subcontrol, QskAspect::Subcontrol proxy );
|
||||
void resetSubcontrolProxy( QskAspect::Subcontrol );
|
||||
QskAspect::Subcontrol subcontrolProxy( QskAspect::Subcontrol ) const;
|
||||
|
||||
bool setAnimationHint( QskAspect, QskAnimationHint );
|
||||
QskAnimationHint animationHint( QskAspect, QskSkinHintStatus* = nullptr ) const;
|
||||
|
||||
@ -110,7 +114,7 @@ class QSK_EXPORT QskSkinnable
|
||||
void startTransition( QskAspect,
|
||||
QskAnimationHint, QVariant from, QVariant to );
|
||||
|
||||
virtual QskAspect::Subcontrol effectiveSubcontrol( QskAspect::Subcontrol ) const;
|
||||
QskAspect::Subcontrol effectiveSubcontrol( QskAspect::Subcontrol ) const;
|
||||
|
||||
QskControl* controlCast();
|
||||
const QskControl* controlCast() const;
|
||||
@ -201,6 +205,8 @@ class QSK_EXPORT QskSkinnable
|
||||
virtual void updateNode( QSGNode* );
|
||||
virtual bool isTransitionAccepted( QskAspect ) const;
|
||||
|
||||
virtual QskAspect::Subcontrol substitutedSubcontrol( QskAspect::Subcontrol ) const;
|
||||
|
||||
QskSkinHintTable& hintTable();
|
||||
const QskSkinHintTable& hintTable() const;
|
||||
|
||||
|
@ -671,7 +671,7 @@ void QskTabBar::handleButtonClick()
|
||||
}
|
||||
}
|
||||
|
||||
QskAspect::Subcontrol QskTabBar::effectiveSubcontrol(
|
||||
QskAspect::Subcontrol QskTabBar::substitutedSubcontrol(
|
||||
QskAspect::Subcontrol subControl ) const
|
||||
{
|
||||
if ( subControl == QskBox::Panel )
|
||||
|
@ -90,9 +90,6 @@ class QSK_EXPORT QskTabBar : public QskBox
|
||||
|
||||
QskAspect::Placement effectivePlacement() const override;
|
||||
|
||||
QskAspect::Subcontrol effectiveSubcontrol(
|
||||
QskAspect::Subcontrol ) const override;
|
||||
|
||||
public Q_SLOTS:
|
||||
void setCurrentIndex( int index );
|
||||
|
||||
@ -108,6 +105,9 @@ class QSK_EXPORT QskTabBar : public QskBox
|
||||
protected:
|
||||
void componentComplete() override;
|
||||
|
||||
QskAspect::Subcontrol substitutedSubcontrol(
|
||||
QskAspect::Subcontrol ) const override;
|
||||
|
||||
private:
|
||||
void adjustCurrentIndex();
|
||||
void handleButtonClick();
|
||||
|
@ -27,7 +27,7 @@ QskDialogButton::~QskDialogButton()
|
||||
{
|
||||
}
|
||||
|
||||
QskAspect::Subcontrol QskDialogButton::effectiveSubcontrol(
|
||||
QskAspect::Subcontrol QskDialogButton::substitutedSubcontrol(
|
||||
QskAspect::Subcontrol subControl ) const
|
||||
{
|
||||
if ( subControl == QskPushButton::Panel )
|
||||
|
@ -29,15 +29,15 @@ class QSK_EXPORT QskDialogButton : public QskPushButton
|
||||
void setAction( QskDialog::Action );
|
||||
QskDialog::Action action() const;
|
||||
|
||||
QskAspect::Subcontrol effectiveSubcontrol(
|
||||
QskAspect::Subcontrol ) const override;
|
||||
|
||||
Q_SIGNALS:
|
||||
void actionChanged();
|
||||
|
||||
protected:
|
||||
void changeEvent( QEvent* ) override;
|
||||
|
||||
QskAspect::Subcontrol substitutedSubcontrol(
|
||||
QskAspect::Subcontrol ) const override;
|
||||
|
||||
private:
|
||||
QskDialog::Action m_action;
|
||||
};
|
||||
|
@ -111,7 +111,7 @@ Qt::Orientation QskDialogButtonBox::orientation() const
|
||||
return m_data->layoutBox->orientation();
|
||||
}
|
||||
|
||||
QskAspect::Subcontrol QskDialogButtonBox::effectiveSubcontrol(
|
||||
QskAspect::Subcontrol QskDialogButtonBox::substitutedSubcontrol(
|
||||
QskAspect::Subcontrol subControl ) const
|
||||
{
|
||||
if ( subControl == QskBox::Panel )
|
||||
|
@ -57,9 +57,6 @@ class QSK_EXPORT QskDialogButtonBox : public QskBox
|
||||
|
||||
QskDialog::Action clickedAction() const;
|
||||
|
||||
QskAspect::Subcontrol effectiveSubcontrol(
|
||||
QskAspect::Subcontrol ) const override;
|
||||
|
||||
void setDefaultButton( QskPushButton* );
|
||||
QskPushButton* defaultButton() const;
|
||||
|
||||
@ -83,6 +80,9 @@ class QSK_EXPORT QskDialogButtonBox : public QskBox
|
||||
virtual QskPushButton* createButton( QskDialog::Action ) const;
|
||||
void invalidateLayout();
|
||||
|
||||
QskAspect::Subcontrol substitutedSubcontrol(
|
||||
QskAspect::Subcontrol ) const override;
|
||||
|
||||
private:
|
||||
void onButtonClicked();
|
||||
void rearrangeButtons();
|
||||
|
@ -28,7 +28,8 @@ namespace
|
||||
initSizePolicy( QskSizePolicy::Ignored, QskSizePolicy::Fixed );
|
||||
}
|
||||
|
||||
QskAspect::Subcontrol effectiveSubcontrol(
|
||||
protected:
|
||||
QskAspect::Subcontrol substitutedSubcontrol(
|
||||
QskAspect::Subcontrol subControl ) const override
|
||||
{
|
||||
if ( subControl == QskTextInput::Panel )
|
||||
@ -40,7 +41,6 @@ namespace
|
||||
return subControl;
|
||||
}
|
||||
|
||||
protected:
|
||||
void focusInEvent( QFocusEvent* ) override
|
||||
{
|
||||
}
|
||||
@ -174,7 +174,7 @@ QQuickItem* QskInputPanelBox::inputProxy() const
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
QskAspect::Subcontrol QskInputPanelBox::effectiveSubcontrol(
|
||||
QskAspect::Subcontrol QskInputPanelBox::substitutedSubcontrol(
|
||||
QskAspect::Subcontrol subControl ) const
|
||||
{
|
||||
if ( subControl == QskBox::Panel )
|
||||
|
@ -52,9 +52,6 @@ class QSK_EXPORT QskInputPanelBox : public QskBox
|
||||
|
||||
QString inputPrompt() const;
|
||||
|
||||
QskAspect::Subcontrol effectiveSubcontrol(
|
||||
QskAspect::Subcontrol ) const override;
|
||||
|
||||
Q_SIGNALS:
|
||||
void panelHintsChanged();
|
||||
void inputPromptChanged( const QString& );
|
||||
@ -69,6 +66,9 @@ class QSK_EXPORT QskInputPanelBox : public QskBox
|
||||
protected:
|
||||
void keyPressEvent( QKeyEvent* ) override;
|
||||
|
||||
QskAspect::Subcontrol substitutedSubcontrol(
|
||||
QskAspect::Subcontrol ) const override;
|
||||
|
||||
private:
|
||||
class PrivateData;
|
||||
std::unique_ptr< PrivateData > m_data;
|
||||
|
@ -43,7 +43,7 @@ namespace
|
||||
return size;
|
||||
}
|
||||
|
||||
QskAspect::Subcontrol effectiveSubcontrol(
|
||||
QskAspect::Subcontrol substitutedSubcontrol(
|
||||
QskAspect::Subcontrol subControl ) const override
|
||||
{
|
||||
if ( subControl == QskPushButton::Panel )
|
||||
@ -97,13 +97,13 @@ QskInputPredictionBar::~QskInputPredictionBar()
|
||||
{
|
||||
}
|
||||
|
||||
QskAspect::Subcontrol QskInputPredictionBar::effectiveSubcontrol(
|
||||
QskAspect::Subcontrol QskInputPredictionBar::substitutedSubcontrol(
|
||||
QskAspect::Subcontrol subControl ) const
|
||||
{
|
||||
if ( subControl == QskBox::Panel )
|
||||
return QskInputPredictionBar::Panel;
|
||||
|
||||
return subControl;
|
||||
return Inherited::substitutedSubcontrol( subControl );
|
||||
}
|
||||
|
||||
void QskInputPredictionBar::setPrediction( const QStringList& candidates )
|
||||
|
@ -20,9 +20,6 @@ class QSK_EXPORT QskInputPredictionBar : public QskBox
|
||||
QskInputPredictionBar( QQuickItem* parent = nullptr );
|
||||
~QskInputPredictionBar() override;
|
||||
|
||||
QskAspect::Subcontrol effectiveSubcontrol(
|
||||
QskAspect::Subcontrol subControl ) const override;
|
||||
|
||||
QStringList candidates() const;
|
||||
|
||||
Q_SIGNALS:
|
||||
@ -32,6 +29,9 @@ class QSK_EXPORT QskInputPredictionBar : public QskBox
|
||||
void setPrediction( const QStringList& );
|
||||
|
||||
private:
|
||||
QskAspect::Subcontrol substitutedSubcontrol(
|
||||
QskAspect::Subcontrol ) const override;
|
||||
|
||||
void buttonClicked();
|
||||
void setScrollOffset( int );
|
||||
|
||||
|
@ -36,7 +36,7 @@ namespace
|
||||
setFocusPolicy( Qt::TabFocus );
|
||||
}
|
||||
|
||||
QskAspect::Subcontrol effectiveSubcontrol(
|
||||
QskAspect::Subcontrol substitutedSubcontrol(
|
||||
QskAspect::Subcontrol subControl ) const override
|
||||
{
|
||||
auto keyBoard = static_cast< const QskVirtualKeyboard* >( parent() );
|
||||
@ -47,7 +47,7 @@ namespace
|
||||
if ( subControl == QskPushButton::Text )
|
||||
return keyBoard->effectiveSubcontrol( QskVirtualKeyboard::ButtonText );
|
||||
|
||||
return QskPushButton::effectiveSubcontrol( subControl );
|
||||
return QskPushButton::substitutedSubcontrol( subControl );
|
||||
}
|
||||
|
||||
int row() const { return m_row; }
|
||||
@ -272,7 +272,7 @@ QskVirtualKeyboard::~QskVirtualKeyboard()
|
||||
{
|
||||
}
|
||||
|
||||
QskAspect::Subcontrol QskVirtualKeyboard::effectiveSubcontrol(
|
||||
QskAspect::Subcontrol QskVirtualKeyboard::substitutedSubcontrol(
|
||||
QskAspect::Subcontrol subControl ) const
|
||||
{
|
||||
if ( subControl == QskBox::Panel )
|
||||
@ -287,7 +287,7 @@ QskAspect::Subcontrol QskVirtualKeyboard::effectiveSubcontrol(
|
||||
return QskPushButton::Text;
|
||||
#endif
|
||||
|
||||
return subControl;
|
||||
return Inherited::substitutedSubcontrol( subControl );
|
||||
}
|
||||
|
||||
QskVirtualKeyboard::Mode QskVirtualKeyboard::mode() const
|
||||
|
@ -35,9 +35,6 @@ class QSK_EXPORT QskVirtualKeyboard : public QskBox
|
||||
|
||||
void updateLocale( const QLocale& );
|
||||
|
||||
QskAspect::Subcontrol effectiveSubcontrol(
|
||||
QskAspect::Subcontrol ) const override;
|
||||
|
||||
bool hasKey( int keyCode ) const;
|
||||
|
||||
Q_SIGNALS:
|
||||
@ -48,6 +45,9 @@ class QSK_EXPORT QskVirtualKeyboard : public QskBox
|
||||
void updateLayout() override;
|
||||
QSizeF layoutSizeHint( Qt::SizeHint, const QSizeF& ) const override;
|
||||
|
||||
QskAspect::Subcontrol substitutedSubcontrol(
|
||||
QskAspect::Subcontrol ) const override;
|
||||
|
||||
private:
|
||||
void buttonPressed();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user