KisRectangleConstraintWidget::KisRectangleConstraintWidget(QWidget *parent, KisToolRectangleBase *tool) : QWidget(parent) { m_tool = tool; setupUi(this); lockWidthButton->setIcon(KisIconUtils::loadIcon("layer-locked")); lockHeightButton->setIcon(KisIconUtils::loadIcon("layer-locked")); lockRatioButton->setIcon(KisIconUtils::loadIcon("layer-locked")); connect(lockWidthButton, SIGNAL(toggled(bool)), this, SLOT(inputsChanged(void))); connect(lockHeightButton, SIGNAL(toggled(bool)), this, SLOT(inputsChanged(void))); connect(lockRatioButton, SIGNAL(toggled(bool)), this, SLOT(inputsChanged(void))); connect(intWidth, SIGNAL(valueChanged(int)), this, SLOT(inputsChanged(void))); connect(intHeight, SIGNAL(valueChanged(int)), this, SLOT(inputsChanged(void))); connect(doubleRatio, SIGNAL(valueChanged(double)), this, SLOT(inputsChanged(void))); connect(this, SIGNAL(constraintsChanged(bool,bool,bool,float,float,float)), m_tool, SLOT(constraintsChanged(bool,bool,bool,float,float,float))); connect(m_tool, SIGNAL(rectangleChanged(QRectF)), this, SLOT(rectangleChanged(QRectF))); }
//TODO: add a settings box to set size of resulting image. Cropping::Cropping(QObject *parent) { widget = new CroppingWidget(); filterWidget = widget; connect(widget, SIGNAL(rectangleChanged()), this, SLOT(recalculate())); if (parent) { /* Connect slots to the filtercontainer */ connect(parent, SIGNAL(selectionColorChanged(QColor)), widget, SLOT(setSelectionColor(QColor))); } }
KisRectangleConstraintWidget::KisRectangleConstraintWidget(QWidget *parent, KisToolRectangleBase *tool) : QWidget(parent) { m_tool = tool; setupUi(this); chkHeight->setIcon(KisIconUtils::loadIcon("height_icon")); chkWidth->setIcon(KisIconUtils::loadIcon("width_icon")); chkRatio->setIcon(KisIconUtils::loadIcon("ratio_icon")); connect(chkWidth, SIGNAL(toggled(bool)), this, SLOT(inputsChanged(void))); connect(chkHeight, SIGNAL(toggled(bool)), this, SLOT(inputsChanged(void))); connect(chkRatio, SIGNAL(toggled(bool)), this, SLOT(inputsChanged(void))); connect(intWidth, SIGNAL(valueChanged(int)), this, SLOT(inputsChanged(void))); connect(intHeight, SIGNAL(valueChanged(int)), this, SLOT(inputsChanged(void))); connect(doubleRatio, SIGNAL(valueChanged(double)), this, SLOT(inputsChanged(void))); connect(this, SIGNAL(constraintsChanged(bool,bool,bool,float,float,float)), m_tool, SLOT(constraintsChanged(bool,bool,bool,float,float,float))); connect(m_tool, SIGNAL(rectangleChanged(QRectF)), this, SLOT(rectangleChanged(QRectF))); }