Squiek settings for the spin box added

This commit is contained in:
Uwe Rathmann 2023-02-27 15:21:09 +01:00
parent c0eb74f292
commit 9b2c2a8f12
3 changed files with 11 additions and 1 deletions

View File

@ -859,6 +859,7 @@ void Editor::setupSpinBox()
{
using Q = QskSpinBox;
setFlagHint( Q::Panel | QskAspect::Style, Q::Buttons );
setSpacing( Q::Panel, 4_dp );
setStrutSize( Q::TextPanel, 80_dp, 40_dp );

View File

@ -1044,6 +1044,14 @@ void Editor::setupSpinBox()
setPadding( subControl, 0.0 );
setStrutSize( subControl, 20, 10 );
setBoxShape( subControl, 0 );
const auto downState = ( subControl == Q::UpPanel )
? Q::Increasing : Q::Decreasing;
setButton( subControl | downState, Sunken, 1.0 );
setAnimation( subControl | A::Metric, 100 );
setAnimation( subControl | A::Color, 100 );
}
for ( auto subControl : { Q::UpIndicator, Q::DownIndicator } )
@ -1052,6 +1060,7 @@ void Editor::setupSpinBox()
#if 1
setFontRole( subControl, QskSkin::TinyFont ); // until it is no graphic
#endif
setAnimation( subControl | A::Color, 100 );
}
}

View File

@ -126,7 +126,7 @@ QRectF QskSpinBoxSkinlet::buttonRect( const QskSkinnable* skinnable,
{
qreal x, y, w, h;
if ( decoration == QskSpinBox::UpDownControl )
if ( decoration == Q::UpDownControl )
{
const auto hint1 = spinBox->strutSizeHint( Q::UpPanel );
const auto hint2 = spinBox->strutSizeHint( Q::DownPanel );