style round button
This commit is contained in:
parent
cd3a6024b8
commit
02e50ce298
|
@ -100,8 +100,6 @@ void Skin::initHints( const Palette& palette )
|
||||||
ed.setColor( TimeLabel::Text, "#6776FF" );
|
ed.setColor( TimeLabel::Text, "#6776FF" );
|
||||||
|
|
||||||
// content in boxes (indoor temperature, humidity etc.):
|
// content in boxes (indoor temperature, humidity etc.):
|
||||||
ed.setFontRole( ButtonValueLabel::Text, QskSkin::HugeFont );
|
|
||||||
ed.setColor( ButtonValueLabel::Text, "#929cb2" );
|
|
||||||
ed.setPadding( BoxWithButtons::Panel, 8 );
|
ed.setPadding( BoxWithButtons::Panel, 8 );
|
||||||
|
|
||||||
ed.setBoxShape( RoundedIcon::Panel, 6 );
|
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::Panel | RoundedIcon::Small | QskAspect::Size, 60 );
|
||||||
ed.setMetric( RoundedIcon::Icon | QskAspect::Size, 36 );
|
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:
|
// diagram:
|
||||||
ed.setBoxBorderMetrics( WeekdayBox::Panel, {0, 0, 3, 3} );
|
ed.setBoxBorderMetrics( WeekdayBox::Panel, {0, 0, 3, 3} );
|
||||||
|
|
||||||
|
|
|
@ -9,31 +9,29 @@
|
||||||
|
|
||||||
QSK_SUBCONTROL( RoundButton, Panel )
|
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 )
|
: QskPushButton( parent )
|
||||||
{
|
{
|
||||||
setSizePolicy( QskSizePolicy::Fixed, QskSizePolicy::Expanding );
|
setSizePolicy( QskSizePolicy::Fixed, QskSizePolicy::Expanding );
|
||||||
setFixedWidth( 42 );
|
|
||||||
setFixedHeight( 46.31 );
|
|
||||||
|
|
||||||
QskGraphic graphic;
|
QskGraphic graphic;
|
||||||
|
QImage image;
|
||||||
|
|
||||||
if( edge == Qt::TopEdge )
|
if( placement == QskAspect::Top )
|
||||||
{
|
{
|
||||||
setBoxShapeHint( RoundButton::Panel, {30, 30, 0, 0} );
|
setSkinStateFlag( Top );
|
||||||
QImage upImage( ":/images/up.png" );
|
image.load( ":/images/up.svg" );
|
||||||
graphic = QskGraphic::fromImage( upImage );
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
setBoxShapeHint( RoundButton::Panel, {0, 0, 30, 30} );
|
image.load( ":/images/down.svg" );
|
||||||
QImage downImage( ":/images/down.png" );
|
|
||||||
graphic = QskGraphic::fromImage( downImage );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
graphic.setDefaultSize( {10, 5.71} );
|
setGraphicSourceSize( image.size() );
|
||||||
|
graphic = QskGraphic::fromImage( image );
|
||||||
setGraphic( graphic );
|
setGraphic( graphic );
|
||||||
setGraphicSourceSize( {10, 5.71} );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QskAspect::Subcontrol RoundButton::effectiveSubcontrol( QskAspect::Subcontrol subControl ) const
|
QskAspect::Subcontrol RoundButton::effectiveSubcontrol( QskAspect::Subcontrol subControl ) const
|
||||||
|
@ -52,6 +50,6 @@ UpAndDownButton::UpAndDownButton( QQuickItem* parent )
|
||||||
setSizePolicy( Qt::Horizontal, QskSizePolicy::Fixed );
|
setSizePolicy( Qt::Horizontal, QskSizePolicy::Fixed );
|
||||||
setSpacing( 0 );
|
setSpacing( 0 );
|
||||||
|
|
||||||
/*auto* upButton =*/ new RoundButton( Qt::TopEdge, this );
|
new RoundButton( QskAspect::Top, this );
|
||||||
/*auto* downButton =*/ new RoundButton( Qt::BottomEdge, this );
|
new RoundButton( QskAspect::Bottom, this );
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,8 +10,9 @@ class RoundButton : QskPushButton
|
||||||
|
|
||||||
public:
|
public:
|
||||||
QSK_SUBCONTROLS( Panel )
|
QSK_SUBCONTROLS( Panel )
|
||||||
|
QSK_STATES( Top )
|
||||||
|
|
||||||
RoundButton( Qt::Edge edge, QQuickItem* parent );
|
RoundButton( QskAspect::Placement placement, QQuickItem* parent );
|
||||||
|
|
||||||
QskAspect::Subcontrol effectiveSubcontrol(
|
QskAspect::Subcontrol effectiveSubcontrol(
|
||||||
QskAspect::Subcontrol subControl ) const override final;
|
QskAspect::Subcontrol subControl ) const override final;
|
||||||
|
|
|
@ -10,8 +10,8 @@
|
||||||
<file>images/logout.png</file>
|
<file>images/logout.png</file>
|
||||||
<file>images/indoor-temperature.png</file>
|
<file>images/indoor-temperature.png</file>
|
||||||
<file>images/humidity.png</file>
|
<file>images/humidity.png</file>
|
||||||
<file>images/up.png</file>
|
<file>images/up.svg</file>
|
||||||
<file>images/down.png</file>
|
<file>images/down.svg</file>
|
||||||
<file>images/lamps.png</file>
|
<file>images/lamps.png</file>
|
||||||
<file>images/music-system.png</file>
|
<file>images/music-system.png</file>
|
||||||
<file>images/ac.png</file>
|
<file>images/ac.png</file>
|
||||||
|
|
Loading…
Reference in New Issue