mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-22 10:00:33 +00:00
playing around with insets
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@2315 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
94c00c08a8
commit
cb8bb668e7
4
NEWS
4
NEWS
@ -18,8 +18,8 @@ Switch to the so-called 'new' insets:
|
|||||||
- TeX mode has been superseded by the 666 (aka ERT) inset, which is
|
- TeX mode has been superseded by the 666 (aka ERT) inset, which is
|
||||||
foldable
|
foldable
|
||||||
|
|
||||||
- new graphics inset superseding the older figure inset [will that be
|
- new graphics inset with support for hassle-free inclusion of various
|
||||||
OK in 1.2.0?]
|
image formats (GIF, JPEG, PNG and EPS by default).
|
||||||
|
|
||||||
- new minipage inset
|
- new minipage inset
|
||||||
|
|
||||||
|
@ -27,7 +27,7 @@
|
|||||||
Bienvenue dans l'univers de LyX !
|
Bienvenue dans l'univers de LyX !
|
||||||
\begin_inset Info
|
\begin_inset Info
|
||||||
Informations de révision :
|
Informations de révision :
|
||||||
Traduction : Mise à jour, Date: 2001/02/16
|
Traduction : Mise à jour, Date: 2001/06/10
|
||||||
Original : Révision: 1.5, Date: 2000/12/28
|
Original : Révision: 1.5, Date: 2000/12/28
|
||||||
\end_inset
|
\end_inset
|
||||||
|
|
||||||
@ -37,8 +37,8 @@ Original : R
|
|||||||
Le Top N des choses à connaître pour utiliser LyX
|
Le Top N des choses à connaître pour utiliser LyX
|
||||||
\layout Enumerate
|
\layout Enumerate
|
||||||
|
|
||||||
LyX est fourni avec une excellente documentation -- servez-vous-en s'il
|
LyX est fourni avec une excellente documentation -- servez-vous-en donc
|
||||||
vous plaît ! Vous pouvez commencer par
|
! Vous pouvez commencer par
|
||||||
\family sans
|
\family sans
|
||||||
\bar under
|
\bar under
|
||||||
A
|
A
|
||||||
@ -58,10 +58,9 @@ A
|
|||||||
\bar default
|
\bar default
|
||||||
ide\SpecialChar \menuseparator
|
ide\SpecialChar \menuseparator
|
||||||
Manuel\SpecialChar ~
|
Manuel\SpecialChar ~
|
||||||
d'Apprentissage.
|
d'Apprentissage
|
||||||
|
|
||||||
\family default
|
\family default
|
||||||
Seul le titre des autres documents est traduit en français pour le moment.
|
.
|
||||||
\layout Enumerate
|
\layout Enumerate
|
||||||
|
|
||||||
LyX est ce qu'on appelle un
|
LyX est ce qu'on appelle un
|
||||||
@ -76,7 +75,7 @@ LyX est ce qu'on appelle un
|
|||||||
Par sa conception, il se distingue des traitements de texte ordinaires
|
Par sa conception, il se distingue des traitements de texte ordinaires
|
||||||
-- en ce sens qu'il facilite l'écriture des documents.
|
-- en ce sens qu'il facilite l'écriture des documents.
|
||||||
Mais la distinction est minime, ne vous inquiétez pas.
|
Mais la distinction est minime, ne vous inquiétez pas.
|
||||||
La documentation est là pour faire toute la lumière la-dessus
|
La documentation est là pour faire toute la lumière là-dessus
|
||||||
\begin_float footnote
|
\begin_float footnote
|
||||||
\layout Standard
|
\layout Standard
|
||||||
|
|
||||||
@ -85,8 +84,7 @@ Avons-nous d
|
|||||||
.
|
.
|
||||||
\layout Enumerate
|
\layout Enumerate
|
||||||
|
|
||||||
Les résultats de mise en page de LyX sont très esthétiques ! Sélectionnez
|
Les résultats de mise en page de LyX sont très esthétiques ! Faites
|
||||||
|
|
||||||
\family sans
|
\family sans
|
||||||
\bar under
|
\bar under
|
||||||
V
|
V
|
||||||
@ -122,15 +120,15 @@ d'Apprentissage
|
|||||||
\layout Enumerate
|
\layout Enumerate
|
||||||
|
|
||||||
LyX possède de nombreuses fonctionnalités pour ceux qui lisent ou écrivent
|
LyX possède de nombreuses fonctionnalités pour ceux qui lisent ou écrivent
|
||||||
d'autres langages que l'anglais.
|
dans d'autres langues que l'anglais.
|
||||||
De plus, le clavier, la barre d'outils et beaucoup d'autres caractéristiques
|
En outre, le clavier, la barre d'outils et beaucoup d'autres caractéristiques
|
||||||
sont pleinement configurables (pour la plupart en éditant votre fichier
|
sont pleinement configurables (pour la plupart en éditant votre fichier
|
||||||
|
|
||||||
\family typewriter
|
\family typewriter
|
||||||
lyxrc
|
lyxrc
|
||||||
\family default
|
\family default
|
||||||
).
|
).
|
||||||
Voir le fichier
|
Voir
|
||||||
\family sans
|
\family sans
|
||||||
\bar under
|
\bar under
|
||||||
A
|
A
|
||||||
|
@ -1,3 +1,16 @@
|
|||||||
|
2001-07-24 Jean-Marc Lasgouttes <lasgouttes@lyx.org>
|
||||||
|
|
||||||
|
* lyxtext.h: remove unused (and unimplemented) methods
|
||||||
|
|
||||||
|
2001-07-23 Jean-Marc Lasgouttes <lasgouttes@lyx.org>
|
||||||
|
|
||||||
|
* text.C (getVisibleRow): honor background color
|
||||||
|
|
||||||
|
* PainterBase.h:
|
||||||
|
* Painter.h: remove default color argument for fillRectangle
|
||||||
|
|
||||||
|
* text.C (backgroundColor): new method
|
||||||
|
|
||||||
2001-07-24 Lars Gullik Bjønnes <larsbj@birdstep.com>
|
2001-07-24 Lars Gullik Bjønnes <larsbj@birdstep.com>
|
||||||
|
|
||||||
* text.C (getVisibleRow): adjust
|
* text.C (getVisibleRow): adjust
|
||||||
|
@ -74,7 +74,7 @@ public:
|
|||||||
|
|
||||||
/// Fill a rectangle
|
/// Fill a rectangle
|
||||||
PainterBase & fillRectangle(int x, int y, int w, int h,
|
PainterBase & fillRectangle(int x, int y, int w, int h,
|
||||||
LColor::color = LColor::background);
|
LColor::color);
|
||||||
|
|
||||||
/// For the graphics inset.
|
/// For the graphics inset.
|
||||||
PainterBase & image(int x, int y, int w, int h, LyXImage const * image);
|
PainterBase & image(int x, int y, int w, int h, LyXImage const * image);
|
||||||
|
@ -137,7 +137,7 @@ public:
|
|||||||
/// Fill a rectangle
|
/// Fill a rectangle
|
||||||
virtual PainterBase & fillRectangle(
|
virtual PainterBase & fillRectangle(
|
||||||
int x, int y, int w, int h,
|
int x, int y, int w, int h,
|
||||||
LColor::color = LColor::background) = 0;
|
LColor::color) = 0;
|
||||||
|
|
||||||
/// A filled rectangle with the shape of a 3D button
|
/// A filled rectangle with the shape of a 3D button
|
||||||
virtual PainterBase & button(int x, int y, int w, int h);
|
virtual PainterBase & button(int x, int y, int w, int h);
|
||||||
|
@ -1,3 +1,34 @@
|
|||||||
|
2001-07-24 Jean-Marc Lasgouttes <lasgouttes@lyx.org>
|
||||||
|
|
||||||
|
* insetminipage.C (InsetMinipage): set background color to red :)
|
||||||
|
|
||||||
|
2001-07-23 Jean-Marc Lasgouttes <lasgouttes@lyx.org>
|
||||||
|
|
||||||
|
* insettext.C (insetUnlock): only set update to CLEAR_FRAME if
|
||||||
|
draw frame mode is LOCKED.
|
||||||
|
|
||||||
|
* insetcollapsable.C (edit):
|
||||||
|
(insetButtonRelease): set update status to full when
|
||||||
|
opening inset.
|
||||||
|
|
||||||
|
* insettext.C (clearInset):
|
||||||
|
* insettabular.C (draw):
|
||||||
|
* insetlatexaccent.C (draw): honor background color.
|
||||||
|
|
||||||
|
* inset.h: new member background_color_, initialized to
|
||||||
|
LColor::inherit.
|
||||||
|
|
||||||
|
* inset.C (backgroundColor): new method.
|
||||||
|
(setBackgroundColor): new method.
|
||||||
|
|
||||||
|
* insetert.C (init): new method, called by the ctors.
|
||||||
|
(InsetERT): when inserting contents, make sure the font is
|
||||||
|
ALL_INHERIT.
|
||||||
|
|
||||||
|
* insetnote.C (InsetNote): when inserting content, remove trailing
|
||||||
|
newline
|
||||||
|
(init): set background color to LColor::note
|
||||||
|
|
||||||
2001-07-24 Lars Gullik Bjønnes <larsbj@birdstep.com>
|
2001-07-24 Lars Gullik Bjønnes <larsbj@birdstep.com>
|
||||||
|
|
||||||
* insetcollapsable.C: adjust
|
* insetcollapsable.C: adjust
|
||||||
|
@ -90,6 +90,24 @@ LyXText * Inset::getLyXText(BufferView const * bv, bool const) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Inset::setBackgroundColor(LColor::color color)
|
||||||
|
{
|
||||||
|
background_color_ = color;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
LColor::color Inset::backgroundColor() const
|
||||||
|
{
|
||||||
|
if (background_color_ == LColor::inherit) {
|
||||||
|
if (owner())
|
||||||
|
return owner()->backgroundColor();
|
||||||
|
else
|
||||||
|
return LColor::background;
|
||||||
|
} else
|
||||||
|
return background_color_;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
int Inset::id() const
|
int Inset::id() const
|
||||||
{
|
{
|
||||||
return id_;
|
return id_;
|
||||||
|
@ -19,6 +19,7 @@
|
|||||||
#include "LString.h"
|
#include "LString.h"
|
||||||
#include <X11/Xlib.h>
|
#include <X11/Xlib.h>
|
||||||
#include "commandtags.h"
|
#include "commandtags.h"
|
||||||
|
#include "LColor.h"
|
||||||
|
|
||||||
class LyXFont;
|
class LyXFont;
|
||||||
class BufferView;
|
class BufferView;
|
||||||
@ -128,7 +129,7 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
///
|
///
|
||||||
Inset() : top_x(0), top_baseline(0), scx(0), id_(inset_id++), owner_(0) {}
|
Inset() : top_x(0), top_baseline(0), scx(0), id_(inset_id++), owner_(0), background_color_(LColor::inherit) {}
|
||||||
/// Virtual base destructor
|
/// Virtual base destructor
|
||||||
virtual ~Inset() {}
|
virtual ~Inset() {}
|
||||||
///
|
///
|
||||||
@ -225,6 +226,10 @@ public:
|
|||||||
///
|
///
|
||||||
Inset * owner() const { return owner_; }
|
Inset * owner() const { return owner_; }
|
||||||
///
|
///
|
||||||
|
void setBackgroundColor(LColor::color);
|
||||||
|
///
|
||||||
|
LColor::color backgroundColor() const;
|
||||||
|
///
|
||||||
int x() const { return top_x; }
|
int x() const { return top_x; }
|
||||||
///
|
///
|
||||||
int y() const { return top_baseline; }
|
int y() const { return top_baseline; }
|
||||||
@ -288,6 +293,8 @@ private:
|
|||||||
Inset * owner_;
|
Inset * owner_;
|
||||||
///
|
///
|
||||||
string name;
|
string name;
|
||||||
|
///
|
||||||
|
LColor::color background_color_;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -289,6 +289,7 @@ void InsetCollapsable::edit(BufferView * bv, bool front)
|
|||||||
collapsed_ = false;
|
collapsed_ = false;
|
||||||
if (!bv->lockInset(this))
|
if (!bv->lockInset(this))
|
||||||
return;
|
return;
|
||||||
|
inset.setUpdateStatus(bv, InsetText::FULL);
|
||||||
bv->updateInset(this, false);
|
bv->updateInset(this, false);
|
||||||
inset.edit(bv, front);
|
inset.edit(bv, front);
|
||||||
} else {
|
} else {
|
||||||
@ -347,6 +348,7 @@ void InsetCollapsable::insetButtonRelease(BufferView * bv,
|
|||||||
draw_label = label;
|
draw_label = label;
|
||||||
collapsed_ = false;
|
collapsed_ = false;
|
||||||
inset.insetButtonRelease(bv, 0, 0, button);
|
inset.insetButtonRelease(bv, 0, 0, button);
|
||||||
|
inset.setUpdateStatus(bv, InsetText::FULL);
|
||||||
bv->updateInset(this, false);
|
bv->updateInset(this, false);
|
||||||
} else {
|
} else {
|
||||||
if (change_label_with_text) {
|
if (change_label_with_text) {
|
||||||
@ -620,8 +622,9 @@ void InsetCollapsable::setLabel(string const & l, bool flag)
|
|||||||
string InsetCollapsable::get_new_label() const
|
string InsetCollapsable::get_new_label() const
|
||||||
{
|
{
|
||||||
string la;
|
string la;
|
||||||
|
Paragraph::size_type const max_length = 10;
|
||||||
|
|
||||||
int n = std::min(10, inset.paragraph()->size());
|
int n = std::min(max_length, inset.paragraph()->size());
|
||||||
int i,j;
|
int i,j;
|
||||||
for(i=0,j=0; i < n && j < inset.paragraph()->size(); ++j) {
|
for(i=0,j=0; i < n && j < inset.paragraph()->size(); ++j) {
|
||||||
if (inset.paragraph()->isInset(j))
|
if (inset.paragraph()->isInset(j))
|
||||||
|
@ -23,37 +23,33 @@
|
|||||||
|
|
||||||
using std::ostream;
|
using std::ostream;
|
||||||
|
|
||||||
InsetERT::InsetERT() : InsetCollapsable()
|
void InsetERT::init()
|
||||||
{
|
{
|
||||||
setLabel(_("666"), true);
|
setLabel(_("666"), true);
|
||||||
//LyXFont font(LyXFont::ALL_SANE);
|
|
||||||
//font.setLatex (LyXFont::ON);
|
|
||||||
labelfont = LyXFont(LyXFont::ALL_SANE);
|
labelfont = LyXFont(LyXFont::ALL_SANE);
|
||||||
labelfont.decSize();
|
labelfont.decSize();
|
||||||
labelfont.decSize();
|
labelfont.decSize();
|
||||||
|
#ifndef NO_LATEX
|
||||||
|
labelfont.setLatex(LyXFont::ON);
|
||||||
|
#else
|
||||||
labelfont.setColor(LColor::latex);
|
labelfont.setColor(LColor::latex);
|
||||||
|
#endif
|
||||||
setAutoCollapse(false);
|
setAutoCollapse(false);
|
||||||
setInsetName("ERT");
|
setInsetName("ERT");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
InsetERT::InsetERT() : InsetCollapsable()
|
||||||
|
{
|
||||||
|
init();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
InsetERT::InsetERT(string const & contents, bool collapsed)
|
InsetERT::InsetERT(string const & contents, bool collapsed)
|
||||||
: InsetCollapsable(collapsed)
|
: InsetCollapsable(collapsed)
|
||||||
{
|
{
|
||||||
setLabel(_("666"));
|
init();
|
||||||
LyXFont font(LyXFont::ALL_SANE);
|
|
||||||
#ifndef NO_LATEX
|
|
||||||
font.setLatex(LyXFont::ON);
|
|
||||||
#else
|
|
||||||
font.setColor(LColor::latex);
|
|
||||||
#endif
|
|
||||||
labelfont = LyXFont(LyXFont::ALL_SANE);
|
|
||||||
labelfont.decSize();
|
|
||||||
labelfont.decSize();
|
|
||||||
labelfont.setColor(LColor::latex);
|
|
||||||
setAutoCollapse(false);
|
|
||||||
setInsetName("ERT");
|
|
||||||
|
|
||||||
|
LyXFont const font(LyXFont::ALL_INHERIT);
|
||||||
string::const_iterator cit = contents.begin();
|
string::const_iterator cit = contents.begin();
|
||||||
string::const_iterator end = contents.end();
|
string::const_iterator end = contents.end();
|
||||||
Paragraph::size_type pos = 0;
|
Paragraph::size_type pos = 0;
|
||||||
|
@ -58,6 +58,9 @@ public:
|
|||||||
virtual int linuxdoc(Buffer const *, std::ostream &) const;
|
virtual int linuxdoc(Buffer const *, std::ostream &) const;
|
||||||
///
|
///
|
||||||
virtual int docBook(Buffer const *, std::ostream &) const;
|
virtual int docBook(Buffer const *, std::ostream &) const;
|
||||||
|
private:
|
||||||
|
///
|
||||||
|
void init();
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -409,7 +409,7 @@ void InsetLatexAccent::draw(BufferView * bv, LyXFont const & font0,
|
|||||||
pain.fillRectangle(int(x + tmpx), tmpvar, wid,
|
pain.fillRectangle(int(x + tmpx), tmpvar, wid,
|
||||||
lyxfont::ascent('i', font) -
|
lyxfont::ascent('i', font) -
|
||||||
lyxfont::ascent('x', font) - 1,
|
lyxfont::ascent('x', font) - 1,
|
||||||
LColor::background);
|
backgroundColor());
|
||||||
// the five lines below is a simple hack to
|
// the five lines below is a simple hack to
|
||||||
// make the display of accent 'i' and 'j'
|
// make the display of accent 'i' and 'j'
|
||||||
// better. It makes the accent be written
|
// better. It makes the accent be written
|
||||||
@ -602,7 +602,8 @@ void InsetLatexAccent::draw(BufferView * bv, LyXFont const & font0,
|
|||||||
baseline - ascent(bv, font) + 1,
|
baseline - ascent(bv, font) + 1,
|
||||||
width(bv, font) - 2,
|
width(bv, font) - 2,
|
||||||
ascent(bv, font)
|
ascent(bv, font)
|
||||||
+ descent(bv, font) - 2);
|
+ descent(bv, font) - 2,
|
||||||
|
backgroundColor());
|
||||||
pain.rectangle(int(x + 1), baseline - ascent(bv, font) + 1,
|
pain.rectangle(int(x + 1), baseline - ascent(bv, font) + 1,
|
||||||
width(bv, font) - 2,
|
width(bv, font) - 2,
|
||||||
ascent(bv, font) + descent(bv, font) - 2);
|
ascent(bv, font) + descent(bv, font) - 2);
|
||||||
|
@ -69,6 +69,8 @@ InsetMinipage::InsetMinipage()
|
|||||||
font.setColor(LColor::collapsable);
|
font.setColor(LColor::collapsable);
|
||||||
setLabelFont(font);
|
setLabelFont(font);
|
||||||
setAutoCollapse(false);
|
setAutoCollapse(false);
|
||||||
|
// just for experimentation :)
|
||||||
|
setBackgroundColor(LColor::red);
|
||||||
setInsetName("Minipage");
|
setInsetName("Minipage");
|
||||||
width_ = "100%"; // set default to 100% of column_width
|
width_ = "100%"; // set default to 100% of column_width
|
||||||
}
|
}
|
||||||
|
@ -22,6 +22,7 @@
|
|||||||
#include "lyxtext.h"
|
#include "lyxtext.h"
|
||||||
#include "insets/insettext.h"
|
#include "insets/insettext.h"
|
||||||
#include "support/LOstream.h"
|
#include "support/LOstream.h"
|
||||||
|
#include "support/lstrings.h"
|
||||||
#include "debug.h"
|
#include "debug.h"
|
||||||
|
|
||||||
using std::ostream;
|
using std::ostream;
|
||||||
@ -32,18 +33,22 @@ void InsetNote::init()
|
|||||||
font.decSize();
|
font.decSize();
|
||||||
font.setColor(LColor::note);
|
font.setColor(LColor::note);
|
||||||
setLabelFont(font);
|
setLabelFont(font);
|
||||||
|
|
||||||
setAutoCollapse(false);
|
setAutoCollapse(false);
|
||||||
|
setBackgroundColor(LColor::note);
|
||||||
|
|
||||||
setLabel(_("note"));
|
setLabel(_("note"));
|
||||||
setInsetName("Note");
|
setInsetName("Note");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
InsetNote::InsetNote()
|
InsetNote::InsetNote()
|
||||||
: InsetCollapsable()
|
: InsetCollapsable()
|
||||||
{
|
{
|
||||||
init();
|
init();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
InsetNote::InsetNote(Buffer const * buf, string const & contents,
|
InsetNote::InsetNote(Buffer const * buf, string const & contents,
|
||||||
bool collapsed)
|
bool collapsed)
|
||||||
: InsetCollapsable(collapsed)
|
: InsetCollapsable(collapsed)
|
||||||
@ -52,9 +57,11 @@ InsetNote::InsetNote(Buffer const * buf, string const & contents,
|
|||||||
|
|
||||||
Paragraph * par = inset.paragraph();
|
Paragraph * par = inset.paragraph();
|
||||||
Paragraph::size_type pos = 0;
|
Paragraph::size_type pos = 0;
|
||||||
buf->insertStringAsLines(par, pos, labelfont, contents);
|
buf->insertStringAsLines(par, pos, LyXFont(LyXFont::ALL_INHERIT),
|
||||||
|
strip(contents, '\n'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Inset * InsetNote::clone(Buffer const &, bool same_id) const
|
Inset * InsetNote::clone(Buffer const &, bool same_id) const
|
||||||
{
|
{
|
||||||
InsetNote * result = new InsetNote;
|
InsetNote * result = new InsetNote;
|
||||||
|
@ -259,7 +259,7 @@ void InsetTabular::draw(BufferView * bv, LyXFont const & font, int baseline,
|
|||||||
h = pain.paperHeight();
|
h = pain.paperHeight();
|
||||||
if ((top_x + w) > pain.paperWidth())
|
if ((top_x + w) > pain.paperWidth())
|
||||||
w = pain.paperWidth();
|
w = pain.paperWidth();
|
||||||
pain.fillRectangle(tx, ty, w, h);
|
pain.fillRectangle(tx, ty, w, h, backgroundColor());
|
||||||
need_update = FULL;
|
need_update = FULL;
|
||||||
cleared = true;
|
cleared = true;
|
||||||
}
|
}
|
||||||
@ -366,7 +366,8 @@ void InsetTabular::draw(BufferView * bv, LyXFont const & font, int baseline,
|
|||||||
baseline - tabular->GetAscentOfRow(i) + 1,
|
baseline - tabular->GetAscentOfRow(i) + 1,
|
||||||
int(cx - nx - 1),
|
int(cx - nx - 1),
|
||||||
tabular->GetAscentOfRow(i) +
|
tabular->GetAscentOfRow(i) +
|
||||||
tabular->GetDescentOfRow(i) - 1);
|
tabular->GetDescentOfRow(i) - 1,
|
||||||
|
backgroundColor());
|
||||||
// clear behind the inset
|
// clear behind the inset
|
||||||
pain.fillRectangle(
|
pain.fillRectangle(
|
||||||
int(cx + the_locking_inset->width(bv,font) + 1),
|
int(cx + the_locking_inset->width(bv,font) + 1),
|
||||||
@ -376,7 +377,8 @@ void InsetTabular::draw(BufferView * bv, LyXFont const & font, int baseline,
|
|||||||
the_locking_inset->width(bv,font) -
|
the_locking_inset->width(bv,font) -
|
||||||
tabular->GetAdditionalWidth(cell) - 1,
|
tabular->GetAdditionalWidth(cell) - 1,
|
||||||
tabular->GetAscentOfRow(i) +
|
tabular->GetAscentOfRow(i) +
|
||||||
tabular->GetDescentOfRow(i) - 1);
|
tabular->GetDescentOfRow(i) - 1,
|
||||||
|
backgroundColor());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
x -= ADD_TO_TABULAR_WIDTH;
|
x -= ADD_TO_TABULAR_WIDTH;
|
||||||
|
@ -472,7 +472,7 @@ void InsetText::clearFrame(Painter & pain, bool cleared) const
|
|||||||
if (!cleared) {
|
if (!cleared) {
|
||||||
pain.rectangle(top_x + 1, top_baseline - insetAscent + 1,
|
pain.rectangle(top_x + 1, top_baseline - insetAscent + 1,
|
||||||
insetWidth - 1, insetAscent + insetDescent - 1,
|
insetWidth - 1, insetAscent + insetDescent - 1,
|
||||||
LColor::background);
|
backgroundColor());
|
||||||
}
|
}
|
||||||
frame_is_visible = false;
|
frame_is_visible = false;
|
||||||
}
|
}
|
||||||
@ -667,7 +667,11 @@ void InsetText::insetUnlock(BufferView * bv)
|
|||||||
hideInsetCursor(bv);
|
hideInsetCursor(bv);
|
||||||
no_selection = false;
|
no_selection = false;
|
||||||
locked = false;
|
locked = false;
|
||||||
int code = CURSOR|CLEAR_FRAME;
|
int code;
|
||||||
|
if (drawFrame_ == LOCKED)
|
||||||
|
code = CURSOR|CLEAR_FRAME;
|
||||||
|
else
|
||||||
|
code = CURSOR;
|
||||||
bool clear = false;
|
bool clear = false;
|
||||||
if (!lt) {
|
if (!lt) {
|
||||||
lt = getLyXText(bv);
|
lt = getLyXText(bv);
|
||||||
@ -1941,7 +1945,8 @@ void InsetText::clearInset(Painter & pain, int baseline, bool & cleared) const
|
|||||||
h = pain.paperHeight();
|
h = pain.paperHeight();
|
||||||
if ((top_x + drawTextXOffset + w) > pain.paperWidth())
|
if ((top_x + drawTextXOffset + w) > pain.paperWidth())
|
||||||
w = pain.paperWidth();
|
w = pain.paperWidth();
|
||||||
pain.fillRectangle(top_x+drawTextXOffset, ty, w, h);
|
pain.fillRectangle(top_x+drawTextXOffset, ty, w, h,
|
||||||
|
backgroundColor());
|
||||||
cleared = true;
|
cleared = true;
|
||||||
need_update = FULL;
|
need_update = FULL;
|
||||||
}
|
}
|
||||||
|
@ -289,8 +289,11 @@ private:
|
|||||||
UpdatableInset::RESULT moveDown(BufferView *);
|
UpdatableInset::RESULT moveDown(BufferView *);
|
||||||
///
|
///
|
||||||
void setCharFont(Buffer const *, int pos, LyXFont const & font);
|
void setCharFont(Buffer const *, int pos, LyXFont const & font);
|
||||||
|
#if 0
|
||||||
|
///What's that ??? Not used, not implemented!
|
||||||
///
|
///
|
||||||
string const getText(int);
|
string const getText(int);
|
||||||
|
#endif
|
||||||
///
|
///
|
||||||
bool checkAndActivateInset(BufferView * bv, bool behind);
|
bool checkAndActivateInset(BufferView * bv, bool behind);
|
||||||
///
|
///
|
||||||
|
@ -22,6 +22,7 @@
|
|||||||
#include "layout.h"
|
#include "layout.h"
|
||||||
#include "lyxrow.h"
|
#include "lyxrow.h"
|
||||||
#include "vspace.h"
|
#include "vspace.h"
|
||||||
|
#include "LColor.h"
|
||||||
|
|
||||||
class Buffer;
|
class Buffer;
|
||||||
class BufferParams;
|
class BufferParams;
|
||||||
@ -392,14 +393,6 @@ public:
|
|||||||
void copyEnvironmentType();
|
void copyEnvironmentType();
|
||||||
///
|
///
|
||||||
void pasteEnvironmentType(BufferView *);
|
void pasteEnvironmentType(BufferView *);
|
||||||
///
|
|
||||||
void insertFootnote();
|
|
||||||
///
|
|
||||||
void insertMarginpar();
|
|
||||||
///
|
|
||||||
void insertFigure();
|
|
||||||
///
|
|
||||||
void insertTabular();
|
|
||||||
|
|
||||||
/** the DTP switches for paragraphs. LyX will store the top settings
|
/** the DTP switches for paragraphs. LyX will store the top settings
|
||||||
always in the first physical paragraph, the bottom settings in the
|
always in the first physical paragraph, the bottom settings in the
|
||||||
@ -606,6 +599,8 @@ private:
|
|||||||
*/
|
*/
|
||||||
bool hfillExpansion(Buffer const *, Row const * row_ptr,
|
bool hfillExpansion(Buffer const *, Row const * row_ptr,
|
||||||
Paragraph::size_type pos) const;
|
Paragraph::size_type pos) const;
|
||||||
|
///
|
||||||
|
LColor::color backgroundColor();
|
||||||
|
|
||||||
|
|
||||||
///
|
///
|
||||||
|
36
src/text.C
36
src/text.C
@ -1159,6 +1159,14 @@ bool LyXText::hfillExpansion(Buffer const * buf, Row const * row_ptr,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
LColor::color LyXText::backgroundColor()
|
||||||
|
{
|
||||||
|
if (inset_owner)
|
||||||
|
return inset_owner->backgroundColor();
|
||||||
|
else
|
||||||
|
return LColor::background;
|
||||||
|
}
|
||||||
|
|
||||||
void LyXText::setHeightOfRow(BufferView * bview, Row * row_ptr) const
|
void LyXText::setHeightOfRow(BufferView * bview, Row * row_ptr) const
|
||||||
{
|
{
|
||||||
/* get the maximum ascent and the maximum descent */
|
/* get the maximum ascent and the maximum descent */
|
||||||
@ -2938,25 +2946,29 @@ void LyXText::getVisibleRow(BufferView * bview, int y_offset, int x_offset,
|
|||||||
int const w = inset_owner ?
|
int const w = inset_owner ?
|
||||||
inset_owner->width(bview, font) - 2 : ww;
|
inset_owner->width(bview, font) - 2 : ww;
|
||||||
int const x = x_offset;
|
int const x = x_offset;
|
||||||
pain.fillRectangle(x, y, w, h);
|
pain.fillRectangle(x, y, w, h, backgroundColor());
|
||||||
} else if (inset != 0) {
|
} else if (inset != 0) {
|
||||||
int h = row_ptr->baseline() - inset->ascent(bview, font);
|
int h = row_ptr->baseline() - inset->ascent(bview, font);
|
||||||
if (h > 0) {
|
if (h > 0) {
|
||||||
int const w = (inset_owner ?
|
int const w = (inset_owner ?
|
||||||
inset_owner->width(bview, font) : ww);
|
inset_owner->width(bview, font) : ww);
|
||||||
pain.fillRectangle(x_offset, y_offset, w, h);
|
pain.fillRectangle(x_offset, y_offset, w, h,
|
||||||
|
backgroundColor());
|
||||||
}
|
}
|
||||||
h += inset->ascent(bview, font) + inset->descent(bview, font);
|
h += inset->ascent(bview, font) + inset->descent(bview, font);
|
||||||
if ((row_ptr->height() - h) > 0) {
|
if ((row_ptr->height() - h) > 0) {
|
||||||
int const w = (inset_owner ?
|
int const w = (inset_owner ?
|
||||||
inset_owner->width(bview, font) : ww);
|
inset_owner->width(bview, font) : ww);
|
||||||
pain.fillRectangle(x_offset, y_offset + h,
|
pain.fillRectangle(x_offset, y_offset + h,
|
||||||
w, row_ptr->height() - h);
|
w, row_ptr->height() - h,
|
||||||
|
backgroundColor());
|
||||||
}
|
}
|
||||||
if (!inset_owner && !inset->display() && !inset->needFullRow())
|
if (!inset_owner && !inset->display() && !inset->needFullRow())
|
||||||
{
|
{
|
||||||
int const w = inset->width(bview, font) + int(x);
|
int const w = inset->width(bview, font) + int(x);
|
||||||
pain.fillRectangle(w, y_offset, ww - w, row_ptr->height());
|
pain.fillRectangle(w, y_offset,
|
||||||
|
ww - w, row_ptr->height(),
|
||||||
|
backgroundColor());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3158,8 +3170,8 @@ void LyXText::getVisibleRow(BufferView * bview, int y_offset, int x_offset,
|
|||||||
0,
|
0,
|
||||||
_("Page Break (top)"),
|
_("Page Break (top)"),
|
||||||
pb_font,
|
pb_font,
|
||||||
LColor::background,
|
backgroundColor(),
|
||||||
LColor::background, false, w, a, d);
|
backgroundColor(), false, w, a, d);
|
||||||
#else
|
#else
|
||||||
;
|
;
|
||||||
lyxfont::rectText(_("Page Break (top)"), pb_font,
|
lyxfont::rectText(_("Page Break (top)"), pb_font,
|
||||||
@ -3169,8 +3181,8 @@ void LyXText::getVisibleRow(BufferView * bview, int y_offset, int x_offset,
|
|||||||
y_offset + y_top + 2 * defaultHeight() + d,
|
y_offset + y_top + 2 * defaultHeight() + d,
|
||||||
_("Page Break (top)"),
|
_("Page Break (top)"),
|
||||||
pb_font,
|
pb_font,
|
||||||
LColor::background,
|
backgroundColor(),
|
||||||
LColor::background);
|
backgroundColor());
|
||||||
y_top += 3 * defaultHeight();
|
y_top += 3 * defaultHeight();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3354,8 +3366,8 @@ void LyXText::getVisibleRow(BufferView * bview, int y_offset, int x_offset,
|
|||||||
.rectText(0, 0,
|
.rectText(0, 0,
|
||||||
_("Page Break (bottom)"),
|
_("Page Break (bottom)"),
|
||||||
pb_font,
|
pb_font,
|
||||||
LColor::background,
|
backgroundColor(),
|
||||||
LColor::background, false, w, a, d);
|
backgroundColor(), false, w, a, d);
|
||||||
#else
|
#else
|
||||||
;
|
;
|
||||||
lyxfont::rectText(_("Page Break (bottom)"), pb_font,
|
lyxfont::rectText(_("Page Break (bottom)"), pb_font,
|
||||||
@ -3364,8 +3376,8 @@ void LyXText::getVisibleRow(BufferView * bview, int y_offset, int x_offset,
|
|||||||
pain.rectText((ww - w) / 2, y_place + d,
|
pain.rectText((ww - w) / 2, y_place + d,
|
||||||
_("Page Break (bottom)"),
|
_("Page Break (bottom)"),
|
||||||
pb_font,
|
pb_font,
|
||||||
LColor::background,
|
backgroundColor(),
|
||||||
LColor::background);
|
backgroundColor());
|
||||||
y_bottom -= 3 * defaultHeight();
|
y_bottom -= 3 * defaultHeight();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user