Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --- kis_layer_box.cpp 2018-02-08 21:47:43.400083755 +0530
- +++ kis_layer_box_my.cpp 2018-02-08 20:36:43.000000000 +0530
- @@ -294,7 +296,9 @@
- action);
- }
- - connectActionToButton(kisview, m_wdgLayerBox->bnAdd, "add_new_paint_layer");
- + connect(m_wdgLayerBox->bnAdd, SIGNAL(clicked()), SLOT(slotBnAddClicked(kisview)));
- +
- + //connectActionToButton(kisview, m_wdgLayerBox->bnAdd, "add_new_paint_layer");
- connectActionToButton(kisview, m_wdgLayerBox->bnDuplicate, "duplicatelayer");
- KisActionManager *actionManager = kisview->actionManager();
- @@ -882,6 +886,28 @@
- m_wdgLayerBox->listLayers->edit(m_wdgLayerBox->listLayers->currentIndex());
- }
- +void KisLayerBox::slotBnAddClicked(KisViewManager* view)
- +{
- + KisNodeList nodes = m_nodeManager->selectedNodes();
- +
- + const bool singleLayer = nodes.size() == 1;
- +
- + if(singleLayer)
- + {
- + KisActionManager *actionManager = view->actionManager();
- +
- + KisAction *action = actionManager->createAction("add_new_paint_layer");
- + Q_ASSERT(action);
- + }
- + else
- + {
- + KisActionManager *actionManager = view->actionManager();
- +
- + KisAction *action = actionManager->createAction("create_quick_group");
- + Q_ASSERT(action);
- + }
- +}
- +
- void KisLayerBox::slotColorLabelChanged(int label)
- {
- KisNodeList nodes = m_nodeManager->selectedNodes();
- --- kis_layer_box.h 2018-02-08 22:50:06.856307642 +0530
- +++ kis_layer_box_my.h 2018-02-08 20:37:56.000000000 +0530
- @@ -94,6 +94,7 @@
- void updateUI();
- void setCurrentNode(KisNodeSP node);
- void slotModelReset();
- + void slotBnAddClicked(KisViewManager* view);
- // from the layerbox to the node manager
Add Comment
Please, Sign In to add comment