mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-06 00:10:59 +00:00
add color mathcorners and implement mathbg (partially)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18277 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
56393b54eb
commit
4d0552dd80
@ -298,6 +298,7 @@ Color::Color()
|
||||
{ graphicsbg, N_("graphics background"), "graphicsbg", "linen", "graphicsbg" },
|
||||
{ mathmacrobg, N_("Math macro background"), "mathmacrobg", "linen", "mathmacrobg" },
|
||||
{ mathframe, N_("math frame"), "mathframe", "Magenta", "mathframe" },
|
||||
{ mathcorners, N_("math corners"), "mathcorners", "linen", "mathcorners" },
|
||||
{ mathline, N_("math line"), "mathline", "Blue", "mathline" },
|
||||
{ captionframe, N_("caption frame"), "captionframe", "DarkRed", "captionframe" },
|
||||
{ collapsable, N_("collapsable inset text"), "collapsable", "DarkRed", "collapsable" },
|
||||
|
@ -123,8 +123,10 @@ public:
|
||||
mathbg,
|
||||
/// Macro math inset background color
|
||||
mathmacrobg,
|
||||
/// Math inset frame color
|
||||
/// Math inset frame color under focus
|
||||
mathframe,
|
||||
/// Math inset frame color not under focus
|
||||
mathcorners,
|
||||
/// Math line color
|
||||
mathline,
|
||||
|
||||
|
@ -288,7 +288,7 @@ void Inset::metricsMarkers2(Dimension & dim, int framesize) const
|
||||
void Inset::drawMarkers(PainterInfo & pi, int x, int y) const
|
||||
{
|
||||
Color::color pen_color = editing(pi.base.bv)?
|
||||
Color::mathframe : Color::background;
|
||||
Color::mathframe : Color::mathcorners;
|
||||
|
||||
int const t = x + width() - 1;
|
||||
int const d = y + descent();
|
||||
@ -303,7 +303,7 @@ void Inset::drawMarkers(PainterInfo & pi, int x, int y) const
|
||||
void Inset::drawMarkers2(PainterInfo & pi, int x, int y) const
|
||||
{
|
||||
Color::color pen_color = editing(pi.base.bv)?
|
||||
Color::mathframe : Color::background;
|
||||
Color::mathframe : Color::mathcorners;
|
||||
|
||||
drawMarkers(pi, x, y);
|
||||
int const t = x + width() - 1;
|
||||
|
@ -52,6 +52,8 @@
|
||||
#include "graphics/PreviewImage.h"
|
||||
#include "graphics/PreviewLoader.h"
|
||||
|
||||
#include "frontends/Painter.h"
|
||||
|
||||
#include "support/lyxlib.h"
|
||||
#include "support/lstrings.h"
|
||||
|
||||
@ -335,6 +337,13 @@ void InsetMathHull::draw(PainterInfo & pi, int x, int y) const
|
||||
{
|
||||
use_preview_ = previewState(pi.base.bv);
|
||||
|
||||
Cursor & cur = pi.base.bv->cursor();
|
||||
// background of mathed under focus is not painted because
|
||||
// selection at the top level of nested inset is difficult to handle.
|
||||
if (!editing(pi.base.bv))
|
||||
pi.pain.fillRectangle(x + 1, y - ascent() + 1, width() - 2,
|
||||
ascent() + descent() - 1, Color::mathbg);
|
||||
|
||||
if (use_preview_) {
|
||||
// one pixel gap in front
|
||||
preview_->draw(pi, x + 1, y);
|
||||
|
Loading…
Reference in New Issue
Block a user