]> git.lyx.org Git - lyx.git/commitdiff
InsetBox.cpp: add visual feedback for frame color
authorUwe Stöhr <uwestoehr@lyx.org>
Sun, 17 May 2015 21:20:43 +0000 (23:20 +0200)
committerUwe Stöhr <uwestoehr@lyx.org>
Sun, 17 May 2015 21:20:43 +0000 (23:20 +0200)
- the idea is to color the box inset frame according to the fame color of the box (if there is any). To keep the WYSIWYM principle the frame thickness and box separation are not taken into account. However this should be possible if anybody would like that.

- besides this, use the correct conversion command for the background color

src/insets/InsetBox.cpp

index 20968d89d6efc38deda5565ded05a0cd6a9cd599..c5bd4ee446c092ec379642fbfcb751db390fdef6 100644 (file)
@@ -158,6 +158,12 @@ void InsetBox::setButtonLabel()
                label = bformat(_("%1$s (%2$s, %3$s)"),
                        type, inner, frame);
        setLabel(label);
+
+       // set the frame color for the inset if the type is Boxed
+       if (btype == Boxed)
+               setFrameColor(lcolor.getFromLaTeXName(params_.framecolor));
+       else
+               setFrameColor(Color_collapsableframe);  
 }
 
 
@@ -210,7 +216,7 @@ ColorCode InsetBox::backgroundColor(PainterInfo const &) const
        } else {
                if (params_.backgroundcolor == "none")
                        return getLayout().bgcolor();
-               ColorCode boxbackground = lcolor.getFromLyXName(params_.backgroundcolor);
+               ColorCode boxbackground = lcolor.getFromLaTeXName(params_.backgroundcolor);
                return boxbackground;
        }
        return getLayout().bgcolor();