X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Finsets%2Finsetinfo.C;h=3c58a89091a6712664fb6cd0b797b7019277fab9;hb=3c8aba3b556871fb1100a2f98cd93d5d4e3f70c9;hp=6d9c9ea9b113797bd13b542d7f167244ee853368;hpb=85798535a19919e82cc94a177a8414c542a9c5bf;p=lyx.git diff --git a/src/insets/insetinfo.C b/src/insets/insetinfo.C index 6d9c9ea9b1..3c58a89091 100644 --- a/src/insets/insetinfo.C +++ b/src/insets/insetinfo.C @@ -24,7 +24,9 @@ #include "buffer.h" #include "support/lstrings.h" #include "Painter.h" +#include "font.h" +using std::ostream; using std::endl; /* Info, used for the Info boxes */ @@ -57,19 +59,19 @@ InsetInfo::~InsetInfo() int InsetInfo::ascent(Painter &, LyXFont const & font) const { - return font.maxAscent() + 1; + return lyxfont::maxAscent(font) + 1; } int InsetInfo::descent(Painter &, LyXFont const & font) const { - return font.maxDescent() + 1; + return lyxfont::maxDescent(font) + 1; } int InsetInfo::width(Painter &, LyXFont const & font) const { - return 6 + font.textWidth(_("Note"), strlen(_("Note"))); + return 6 + lyxfont::width(_("Note"), font); } @@ -79,16 +81,18 @@ void InsetInfo::draw(Painter & pain, LyXFont const & f, LyXFont font(f); /* Info-insets are never LaTeX, so just correct the font */ - font.setLatex(LyXFont::OFF); - + font.setLatex(LyXFont::OFF).setColor(LColor::note); + // Draw as "Note" in a yellow box x += 1; pain.fillRectangle(int(x), baseline - ascent(pain, font) + 1, width(pain, font) - 2, - ascent(pain, font) + descent(pain, font) - 2); + ascent(pain, font) + descent(pain, font) - 2, + LColor::notebg); pain.rectangle(int(x), baseline - ascent(pain, font) + 1, width(pain, font) - 2, - ascent(pain, font) + descent(pain, font) - 2); + ascent(pain, font) + descent(pain, font) - 2, + LColor::noteframe); pain.text(int(x + 2), baseline, _("Note"), font); x += width(pain, font) - 1; @@ -129,7 +133,13 @@ void InsetInfo::Read(LyXLex & lex) int InsetInfo::Latex(ostream &, - signed char /*fragile*/, bool /*free_spc*/) const + bool /*fragile*/, bool /*free_spc*/) const +{ + return 0; +} + + +int InsetInfo::Ascii(ostream &) const { return 0; } @@ -177,6 +187,12 @@ extern "C" void C_InsetInfo_CloseInfoCB(FL_OBJECT * ob, long data) } +char const * InsetInfo::EditMessage() const +{ + return _("Opened note"); +} + + void InsetInfo::Edit(BufferView *bv, int, int, unsigned int) { static int ow = -1, oh;