From 6df25c3585ddbd26d806c141fc3b577f5525e214 Mon Sep 17 00:00:00 2001 From: Juergen Spitzmueller Date: Sun, 1 Oct 2023 11:08:11 +0200 Subject: [PATCH] When box background is "none", frame color != black and page color has been set then use the page color as box background, not white --- src/insets/InsetBox.cpp | 8 ++++---- src/insets/InsetBox.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/insets/InsetBox.cpp b/src/insets/InsetBox.cpp index 8adf0f7fe0..b1444ecd79 100644 --- a/src/insets/InsetBox.cpp +++ b/src/insets/InsetBox.cpp @@ -433,7 +433,7 @@ void InsetBox::latex(otexstream & os, OutputParams const & runparams) const if (useFColorBox()) { os << maybeBeginL << "\\fcolorbox{" << getFrameColor() - << "}{" << getBackgroundColor() + << "}{" << getBackgroundColor(buffer().params().isbackgroundcolor) << "}{" << "\\makebox"; needEndL = !maybeBeginL.empty(); } else @@ -454,7 +454,7 @@ void InsetBox::latex(otexstream & os, OutputParams const & runparams) const if (useFColorBox()) { os << maybeBeginL << "\\fcolorbox{" << getFrameColor() - << "}{" << getBackgroundColor() << "}"; + << "}{" << getBackgroundColor(buffer().params().isbackgroundcolor) << "}"; needEndL = !maybeBeginL.empty(); } else { if (!cprotect.empty() && contains(runparams.active_chars, '^')) { @@ -887,10 +887,10 @@ string const InsetBox::getFrameColor(bool const gui) const } -string const InsetBox::getBackgroundColor() const +string const InsetBox::getBackgroundColor(bool const custompb) const { if (params_.backgroundcolor == "none") - return "white"; + return custompb ? "page_backgroundcolor" : "white"; return params_.backgroundcolor; } diff --git a/src/insets/InsetBox.h b/src/insets/InsetBox.h index f4a743667b..29c713716c 100644 --- a/src/insets/InsetBox.h +++ b/src/insets/InsetBox.h @@ -166,7 +166,7 @@ private: /// std::string const getFrameColor(bool const gui = false) const; /// - std::string const getBackgroundColor() const; + std::string const getBackgroundColor(bool const custompb = false) const; /// bool useFColorBox() const;