mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-22 01:59:02 +00:00
Fix shaded box UI color (#7395) as good as it gets ATM
This commit is contained in:
parent
e235b96378
commit
ee0860e403
@ -819,6 +819,7 @@ string BufferParams::readToken(Lexer & lex, string const & token,
|
||||
lex.eatLine();
|
||||
string color = lex.getString();
|
||||
boxbgcolor = lyx::rgbFromHexName(color);
|
||||
lcolor.setColor("boxbgcolor", color);
|
||||
} else if (token == "\\paperwidth") {
|
||||
lex >> paperwidth;
|
||||
} else if (token == "\\paperheight") {
|
||||
|
@ -17,6 +17,7 @@
|
||||
#include "Buffer.h"
|
||||
#include "BufferParams.h"
|
||||
#include "BufferView.h"
|
||||
#include "ColorSet.h"
|
||||
#include "Cursor.h"
|
||||
#include "DispatchResult.h"
|
||||
#include "FuncStatus.h"
|
||||
@ -184,6 +185,20 @@ bool InsetBox::forcePlainLayout(idx_type) const
|
||||
}
|
||||
|
||||
|
||||
ColorCode InsetBox::backgroundColor(PainterInfo const &) const
|
||||
{
|
||||
if (params_.type != "Shaded")
|
||||
return getLayout().bgcolor();
|
||||
// FIXME: This hardcoded color is a hack!
|
||||
if (buffer().params().boxbgcolor == lyx::rgbFromHexName("#ff0000"))
|
||||
return getLayout().bgcolor();
|
||||
ColorCode c = lcolor.getFromLyXName("boxbgcolor");
|
||||
if (c == Color_none)
|
||||
return getLayout().bgcolor();
|
||||
return c;
|
||||
}
|
||||
|
||||
|
||||
void InsetBox::doDispatch(Cursor & cur, FuncRequest & cmd)
|
||||
{
|
||||
switch (cmd.action()) {
|
||||
|
@ -102,6 +102,8 @@ public:
|
||||
///
|
||||
DisplayType display() const { return Inline; }
|
||||
///
|
||||
ColorCode backgroundColor(PainterInfo const &) const;
|
||||
///
|
||||
bool allowParagraphCustomization(idx_type = 0) const { return !forcePlainLayout(); }
|
||||
///
|
||||
bool forcePlainLayout(idx_type = 0) const;
|
||||
|
Loading…
Reference in New Issue
Block a user