code adjusted to M3 wordings

This commit is contained in:
Uwe Rathmann 2024-10-22 15:45:09 +02:00
parent c3b3da2ad3
commit 963f0aff27

View File

@ -15,24 +15,43 @@ namespace
class Slider : public QskSlider
{
public:
enum Style
{
Continous,
Discrete,
Centered
};
Slider( Qt::Orientation orientation,
bool snap, QQuickItem* parent = nullptr )
Style style, QQuickItem* parent = nullptr )
: QskSlider( orientation, parent )
{
setBoundaries( 0, 100 );
setValue( 30 );
setSnap( snap );
switch( style )
{
case Discrete:
{
setSnap( true );
setStepSize( 5 );
setPageSteps( 4 );
if ( snap )
{
setStepSize( 5 );
setPageSteps( 4 );
}
else
{
setStepSize( 1 );
setPageSteps( 10 );
break;
}
case Continous:
{
setSnap( false );
setStepSize( 1 );
setPageSteps( 10 );
break;
}
case Centered:
{
// TODO
break;
}
}
#if 0
@ -75,11 +94,19 @@ namespace
InputPage::InputPage( QQuickItem* parent )
: Page( Qt::Horizontal, parent )
{
auto sliderH = new Slider( Qt::Horizontal, false );
auto discreteSliderH = new Slider( Qt::Horizontal, true );
struct
{
Slider* continous;
Slider* descrete;
} sliders[2];
auto sliderV = new Slider( Qt::Vertical, false );
auto discreteSliderV = new Slider( Qt::Vertical, true );
for ( int i = 0; i < 2; i++ )
{
const auto orientation = static_cast< Qt::Orientation >( i + 1 );
sliders[i].continous = new Slider( orientation, Slider::Continous );
sliders[i].descrete = new Slider( orientation, Slider::Discrete );
}
auto spinBox = new QskSpinBox( 0.0, 100.0, 1.0 );
spinBox->setSizePolicy( Qt::Horizontal, QskSizePolicy::Fixed );
@ -91,15 +118,15 @@ InputPage::InputPage( QQuickItem* parent )
vBox->setSpacing( 30 );
vBox->setExtraSpacingAt( Qt::RightEdge | Qt::BottomEdge );
vBox->addItem( sliderH );
vBox->addItem( discreteSliderH );
vBox->addItem( sliders[0].continous );
vBox->addItem( sliders[0].descrete );
vBox->addItem( inputBox );
vBox->addItem( spinBox );
auto mainBox = new QskLinearBox( Qt::Horizontal, this );
mainBox->setSpacing( 30 );
mainBox->addItem( sliderV );
mainBox->addItem( discreteSliderV );
mainBox->addItem( sliders[1].continous );
mainBox->addItem( sliders[1].descrete );
mainBox->addItem( vBox );
auto inputs = findChildren< QskBoundedValueInput* >();