diff --git a/examples/iot-dashboard/Skin.cpp b/examples/iot-dashboard/Skin.cpp
index e11ed558..0ec64cb6 100644
--- a/examples/iot-dashboard/Skin.cpp
+++ b/examples/iot-dashboard/Skin.cpp
@@ -100,8 +100,6 @@ void Skin::initHints( const Palette& palette )
ed.setColor( TimeLabel::Text, "#6776FF" );
// content in boxes (indoor temperature, humidity etc.):
- ed.setFontRole( ButtonValueLabel::Text, QskSkin::HugeFont );
- ed.setColor( ButtonValueLabel::Text, "#929cb2" );
ed.setPadding( BoxWithButtons::Panel, 8 );
ed.setBoxShape( RoundedIcon::Panel, 6 );
@@ -111,6 +109,13 @@ void Skin::initHints( const Palette& palette )
ed.setMetric( RoundedIcon::Panel | RoundedIcon::Small | QskAspect::Size, 60 );
ed.setMetric( RoundedIcon::Icon | QskAspect::Size, 36 );
+ ed.setFontRole( ButtonValueLabel::Text, QskSkin::HugeFont );
+ ed.setColor( ButtonValueLabel::Text, "#929cb2" );
+
+ ed.setStrutSize( RoundButton::Panel, {27, 38} );
+ ed.setBoxShape( RoundButton::Panel, {0, 0, 30, 30} );
+ ed.setBoxShape( RoundButton::Panel | RoundButton::Top, {30, 30, 0, 0} );
+
// diagram:
ed.setBoxBorderMetrics( WeekdayBox::Panel, {0, 0, 3, 3} );
diff --git a/examples/iot-dashboard/UpAndDownButton.cpp b/examples/iot-dashboard/UpAndDownButton.cpp
index d5f9ce9b..07135c78 100644
--- a/examples/iot-dashboard/UpAndDownButton.cpp
+++ b/examples/iot-dashboard/UpAndDownButton.cpp
@@ -9,31 +9,29 @@
QSK_SUBCONTROL( RoundButton, Panel )
-RoundButton::RoundButton( Qt::Edge edge, QQuickItem* parent )
+QSK_STATE( RoundButton, Top, ( QskAspect::FirstUserState << 1 ) )
+
+RoundButton::RoundButton( QskAspect::Placement placement, QQuickItem* parent )
: QskPushButton( parent )
{
setSizePolicy( QskSizePolicy::Fixed, QskSizePolicy::Expanding );
- setFixedWidth( 42 );
- setFixedHeight( 46.31 );
QskGraphic graphic;
+ QImage image;
- if( edge == Qt::TopEdge )
+ if( placement == QskAspect::Top )
{
- setBoxShapeHint( RoundButton::Panel, {30, 30, 0, 0} );
- QImage upImage( ":/images/up.png" );
- graphic = QskGraphic::fromImage( upImage );
+ setSkinStateFlag( Top );
+ image.load( ":/images/up.svg" );
}
else
{
- setBoxShapeHint( RoundButton::Panel, {0, 0, 30, 30} );
- QImage downImage( ":/images/down.png" );
- graphic = QskGraphic::fromImage( downImage );
+ image.load( ":/images/down.svg" );
}
- graphic.setDefaultSize( {10, 5.71} );
+ setGraphicSourceSize( image.size() );
+ graphic = QskGraphic::fromImage( image );
setGraphic( graphic );
- setGraphicSourceSize( {10, 5.71} );
}
QskAspect::Subcontrol RoundButton::effectiveSubcontrol( QskAspect::Subcontrol subControl ) const
@@ -52,6 +50,6 @@ UpAndDownButton::UpAndDownButton( QQuickItem* parent )
setSizePolicy( Qt::Horizontal, QskSizePolicy::Fixed );
setSpacing( 0 );
- /*auto* upButton =*/ new RoundButton( Qt::TopEdge, this );
- /*auto* downButton =*/ new RoundButton( Qt::BottomEdge, this );
+ new RoundButton( QskAspect::Top, this );
+ new RoundButton( QskAspect::Bottom, this );
}
diff --git a/examples/iot-dashboard/UpAndDownButton.h b/examples/iot-dashboard/UpAndDownButton.h
index 90c06cb1..5ee7fa6d 100644
--- a/examples/iot-dashboard/UpAndDownButton.h
+++ b/examples/iot-dashboard/UpAndDownButton.h
@@ -10,8 +10,9 @@ class RoundButton : QskPushButton
public:
QSK_SUBCONTROLS( Panel )
+ QSK_STATES( Top )
- RoundButton( Qt::Edge edge, QQuickItem* parent );
+ RoundButton( QskAspect::Placement placement, QQuickItem* parent );
QskAspect::Subcontrol effectiveSubcontrol(
QskAspect::Subcontrol subControl ) const override final;
diff --git a/examples/iot-dashboard/images.qrc b/examples/iot-dashboard/images.qrc
index f98310f0..f1db9634 100644
--- a/examples/iot-dashboard/images.qrc
+++ b/examples/iot-dashboard/images.qrc
@@ -10,8 +10,8 @@
images/logout.png
images/indoor-temperature.png
images/humidity.png
- images/up.png
- images/down.png
+ images/up.svg
+ images/down.svg
images/lamps.png
images/music-system.png
images/ac.png