InsetBox.cpp: add visual feedback for frame color

- 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
This commit is contained in:
Uwe Stöhr 2015-05-17 23:20:43 +02:00
parent 61448d8cb2
commit 52a158b6d7

View 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();