]> git.lyx.org Git - features.git/commitdiff
When box background is "none", frame color != black and page color has been set
authorJuergen Spitzmueller <spitz@lyx.org>
Sun, 1 Oct 2023 09:08:11 +0000 (11:08 +0200)
committerJuergen Spitzmueller <spitz@lyx.org>
Sun, 1 Oct 2023 09:08:11 +0000 (11:08 +0200)
then use the page color as box background, not white

src/insets/InsetBox.cpp
src/insets/InsetBox.h

index 8adf0f7fe02b87ee3cda385384bfc3519f3a1374..b1444ecd79cd8f7b861de0cbf243debe6159f6a2 100644 (file)
@@ -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;
 }
 
index f4a743667bbf9826c822df9443fb96efd41b637e..29c713716c2a56cbdb1bb102a3744301b1957fa2 100644 (file)
@@ -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;