summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2018-02-13 11:03:03 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2018-02-13 11:26:59 +0100
commit179fbaf3687fc40d75a2570639191f797f03ce4e (patch)
tree0d426eccd2b4b839033b8daf6dc5eb660290dbc8
parent2d62a1016438ea0bc079e6de3a5bcdcb34680f43 (diff)
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@libreoffice.org> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
-rw-r--r--vcl/source/control/fixed.cxx21
-rw-r--r--vcl/source/window/toolbox.cxx2
2 files changed, 15 insertions, 8 deletions
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());
}
}