[Libreoffice-commits] core.git: vcl/source

Mike Kaganski mike.kaganski at collabora.com
Tue Feb 13 10:27:21 UTC 2018


 vcl/source/control/fixed.cxx  |   21 +++++++++++++--------
 vcl/source/window/toolbox.cxx |    2 ++
 2 files changed, 15 insertions(+), 8 deletions(-)

New commits:
commit 179fbaf3687fc40d75a2570639191f797f03ce4e
Author: Mike Kaganski <mike.kaganski at collabora.com>
Date:   Tue Feb 13 11:03:03 2018 +0300

    tdf#94341: Set child transparent mode for ToolBox
    
    Push buttons don't rely on their parent's child transparent mode
    since i#38498. This allows buttons to have proper transparency
    mode, despite toolboxes don't set their children transparency mode
    at all (even being transparent themselves).
    
    However, when other controls are placed to toolboxes, as FixedText,
    they check parent's child transparent mode, and then use parent's
    background for them. For transparent toolboxes this makes the
    background to be NONE, and thus on invalidation of such FixedText,
    neither parent's area, nor FixedText's is filled to remove previous
    text before outputting new text.
    
    This patch sets ToolBox child transparent mode depending on its own
    transparency. Also, FixedText now checks if background applied in
    ApplySettings is empty, and if it is, sets transparency mode despite
    parent's setting.
    
    Change-Id: Id424cbad894bb42a88a4b027f2a964d6e542f115
    Reviewed-on: https://gerrit.libreoffice.org/49621
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Mike Kaganski <mike.kaganski at collabora.com>

diff --git a/vcl/source/control/fixed.cxx b/vcl/source/control/fixed.cxx
index a38f2e7a6506..d417f97ece07 100644
--- a/vcl/source/control/fixed.cxx
+++ b/vcl/source/control/fixed.cxx
@@ -183,14 +183,8 @@ void FixedText::ApplySettings(vcl::RenderContext& rRenderContext)
     Control::ApplySettings(rRenderContext);
 
     vcl::Window* pParent = GetParent();
-    if (pParent->IsChildTransparentModeEnabled() && !IsControlBackground())
-    {
-        EnableChildTransparentMode();
-        SetParentClipMode(ParentClipMode::NoClip);
-        SetPaintTransparent(true);
-        rRenderContext.SetBackground();
-    }
-    else
+    bool bEnableTransparent = true;
+    if (!pParent->IsChildTransparentModeEnabled() || IsControlBackground())
     {
         EnableChildTransparentMode(false);
         SetParentClipMode();
@@ -200,6 +194,17 @@ void FixedText::ApplySettings(vcl::RenderContext& rRenderContext)
             rRenderContext.SetBackground(GetControlBackground());
         else
             rRenderContext.SetBackground(pParent->GetBackground());
+
+        if (rRenderContext.IsBackground())
+            bEnableTransparent = false;
+    }
+
+    if (bEnableTransparent)
+    {
+        EnableChildTransparentMode();
+        SetParentClipMode(ParentClipMode::NoClip);
+        SetPaintTransparent(true);
+        rRenderContext.SetBackground();
     }
 }
 
diff --git a/vcl/source/window/toolbox.cxx b/vcl/source/window/toolbox.cxx
index 111c8759cd03..a2b1400507ce 100644
--- a/vcl/source/window/toolbox.cxx
+++ b/vcl/source/window/toolbox.cxx
@@ -1292,6 +1292,8 @@ void ToolBox::ImplInitSettings(bool bFont, bool bForeground, bool bBackground)
                 SetParentClipMode();
             }
         }
+
+        EnableChildTransparentMode(IsPaintTransparent());
     }
 }
 


More information about the Libreoffice-commits mailing list