KisCompositeOpOption::KisCompositeOpOption(bool createConfigWidget):
    KisPaintOpOption(i18n("Blending Mode"), KisPaintOpOption::brushCategory(), true),
    m_createConfigWidget(createConfigWidget)
{
    m_checkable         = false;
    m_prevCompositeOpID = KoCompositeOpRegistry::instance().getDefaultCompositeOp().id();
    m_currCompositeOpID = m_prevCompositeOpID;
    
    if(createConfigWidget) {
        QWidget* widget = new QWidget();
        
        Ui_wdgCompositeOpOption ui;
        ui.setupUi(widget);
        ui.bnEraser->setIcon(koIcon("draw-eraser"));
        
        m_label    = ui.lbChoosenMode;
        m_list     = ui.list;
        m_bnEraser = ui.bnEraser;
        
        setConfigurationPage(widget);
        
        connect(ui.list    , SIGNAL(activated(const QModelIndex&)), this, SLOT(slotCompositeOpChanged(const QModelIndex&)));
        connect(ui.bnEraser, SIGNAL(toggled(bool))                , this, SLOT(slotEraserToggled(bool)));
    }
}
Ejemplo n.º 2
0
KisCompositeOpOption::KisCompositeOpOption(bool createConfigWidget):
    KisPaintOpOption(KisPaintOpOption::GENERAL, true),
    m_createConfigWidget(createConfigWidget),
    m_eraserMode(false)
{
    m_checkable         = false;
    m_currCompositeOpID = KoCompositeOpRegistry::instance().getDefaultCompositeOp().id();

    if (createConfigWidget) {
        QWidget* widget = new QWidget();

        Ui_wdgCompositeOpOption ui;
        ui.setupUi(widget);
        ui.bnEraser->setIcon(KisIconUtils::loadIcon("draw-eraser"));

        m_label    = ui.lbChoosenMode;
        m_list     = ui.list;
        m_bnEraser = ui.bnEraser;

        setConfigurationPage(widget);

        connect(ui.list    , SIGNAL(clicked(const QModelIndex&)), this, SLOT(slotCompositeOpChanged(const QModelIndex&)));
        connect(ui.bnEraser, SIGNAL(toggled(bool))                , this, SLOT(slotEraserToggled(bool)));
    }

    setObjectName("KisCompositeOpOption");

}