void ToolOptionWidget::updateUI() { BaseTool* currentTool = editor()->tools()->currentTool(); Q_ASSERT( currentTool ); disableAllOptions(); mSizeSlider->setVisible( currentTool->isPropertyEnabled( WIDTH ) ); mBrushSpinBox->setVisible( currentTool->isPropertyEnabled( WIDTH) ); mFeatherSlider->setVisible( currentTool->isPropertyEnabled( FEATHER ) ); mUseFeatherBox->setVisible( currentTool->isPropertyEnabled( FEATHER ) ); mFeatherSpinBox->setVisible( currentTool->isPropertyEnabled( FEATHER) ); mUseBezierBox->setVisible( currentTool->isPropertyEnabled( BEZIER ) ); mUsePressureBox->setVisible( currentTool->isPropertyEnabled( PRESSURE ) ); mMakeInvisibleBox->setVisible( currentTool->isPropertyEnabled( INVISIBILITY ) ); mPreserveAlphaBox->setVisible( currentTool->isPropertyEnabled( PRESERVEALPHA ) ); const Properties& p = currentTool->properties; setPenWidth( p.width ); setPenFeather( p.feather ); setPressure( p.pressure ); setPenInvisibility( p.invisibility ); setPreserveAlpha( p.preserveAlpha ); }
void ToolOptionWidget::updateUI() { BaseTool* currentTool = editor()->tools()->currentTool(); Q_ASSERT( currentTool ); disableAllOptions(); mSizeSlider->setVisible( currentTool->isPropertyEnabled( WIDTH ) ); mBrushSpinBox->setVisible( currentTool->isPropertyEnabled( WIDTH) ); mFeatherSlider->setVisible( currentTool->isPropertyEnabled( FEATHER ) ); mUseFeatherBox->setVisible( currentTool->isPropertyEnabled( FEATHER ) ); mFeatherSpinBox->setVisible( currentTool->isPropertyEnabled( FEATHER) ); mUseBezierBox->setVisible( currentTool->isPropertyEnabled( BEZIER ) ); mUsePressureBox->setVisible( currentTool->isPropertyEnabled( PRESSURE ) ); mMakeInvisibleBox->setVisible( currentTool->isPropertyEnabled( INVISIBILITY ) ); mPreserveAlphaBox->setVisible( currentTool->isPropertyEnabled( PRESERVEALPHA ) ); mUseAABox->setVisible(currentTool->isPropertyEnabled( ANTI_ALIASING ) ); mInpolLevelsBox->setVisible(currentTool->isPropertyEnabled( INTERPOLATION ) ); auto currentLayerType = editor()->layers()->currentLayer()->type(); if(currentLayerType == Layer::VECTOR) { mVectorMergeBox->setVisible( currentTool->isPropertyEnabled( VECTORMERGE) ); } const Properties& p = currentTool->properties; setPenWidth( p.width ); setPenFeather( p.feather ); setPressure( p.pressure ); setPenInvisibility( p.invisibility ); setPreserveAlpha( p.preserveAlpha ); setVectorMergeEnabled( p.vectorMergeEnabled ); setAA(p.useAA); setInpolLevel(p.inpolLevel); }