[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [calligra] krita/plugins/extensions/dockers/defaultdockers: Disable opacity and composite op control
From:       Boudewijn Rempt <boud () valdyas ! org>
Date:       2013-09-28 10:53:13
Message-ID: E1VPs9B-0001pD-CY () scm ! kde ! org
[Download RAW message or body]

Git commit ad00649eb7f410806e2bbe383287620f70e6b656 by Boudewijn Rempt.
Committed on 28/09/2013 at 10:50.
Pushed by rempt into branch 'master'.

Disable opacity and composite op controls for masks

These don't make sense for masks, so in the previous code, we'd set the
opacity and composite op to the one set on the layer, leading to

BUG:324503

M  +17   -12   krita/plugins/extensions/dockers/defaultdockers/kis_layer_box.cpp

http://commits.kde.org/calligra/ad00649eb7f410806e2bbe383287620f70e6b656

diff --git a/krita/plugins/extensions/dockers/defaultdockers/kis_layer_box.cpp \
b/krita/plugins/extensions/dockers/defaultdockers/kis_layer_box.cpp index \
                5aa6a12..31c8aaa 100644
--- a/krita/plugins/extensions/dockers/defaultdockers/kis_layer_box.cpp
+++ b/krita/plugins/extensions/dockers/defaultdockers/kis_layer_box.cpp
@@ -366,30 +366,35 @@ void KisLayerBox::updateUI()
 {
     if(!m_canvas) return;
 
-    KisNodeSP active = m_nodeManager->activeNode();
+    KisNodeSP activeNode = m_nodeManager->activeNode();
 
-    m_wdgLayerBox->bnRaise->setEnabled(active && active->isEditable() && \
                (active->nextSibling()
-                                       || (active->parent() && active->parent() != \
                m_image->root())));
-    m_wdgLayerBox->bnLower->setEnabled(active && active->isEditable() && \
                (active->prevSibling()
-                                       || (active->parent() && active->parent() != \
m_image->root()))); +    m_wdgLayerBox->bnRaise->setEnabled(activeNode && \
activeNode->isEditable() && (activeNode->nextSibling() +                              \
|| (activeNode->parent() && activeNode->parent() != m_image->root()))); +    \
m_wdgLayerBox->bnLower->setEnabled(activeNode && activeNode->isEditable() && \
(activeNode->prevSibling() +                                       || \
(activeNode->parent() && activeNode->parent() != m_image->root())));  
-    m_wdgLayerBox->doubleOpacity->setEnabled(active && active->isEditable());
+    m_wdgLayerBox->doubleOpacity->setEnabled(activeNode && \
activeNode->isEditable());  m_wdgLayerBox->doubleOpacity->setRange(0, 100, 0);
 
-    m_wdgLayerBox->cmbComposite->setEnabled(active && active->isEditable());
+    m_wdgLayerBox->cmbComposite->setEnabled(activeNode && activeNode->isEditable());
 
-    if (active) {
+    if (activeNode) {
         if (m_nodeManager->activePaintDevice()) {
             slotFillCompositeOps(m_nodeManager->activeColorSpace());
         } else {
             slotFillCompositeOps(m_image->colorSpace());
         }
 
-        if (active->inherits("KisMask")) {
-            active = active->parent(); // We need a layer to set opacity and \
composite op, which masks don't have +        if (activeNode->inherits("KisMask")) {
+            m_wdgLayerBox->cmbComposite->setEnabled(false);
+            m_wdgLayerBox->doubleOpacity->setEnabled(false);
         }
-        if (active->inherits("KisLayer")) {
-            KisLayerSP l = qobject_cast<KisLayer*>(active.data());
+
+        if (activeNode->inherits("KisLayer")) {
+            m_wdgLayerBox->cmbComposite->setEnabled(true);
+            m_wdgLayerBox->doubleOpacity->setEnabled(true);
+
+            KisLayerSP l = qobject_cast<KisLayer*>(activeNode.data());
             slotSetOpacity(l->opacity() * 100.0 / 255);
 
             const KoCompositeOp* compositeOp = l->compositeOp();


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic