Hi,
I think that the visual 'Index entry' is not at all a WYSIWYG feature.
I mean it is not necessary to show them as very heavy buttons.
Intuitively, it is clear that any index entry contains the closest word or phrase.
Anyway it is duplicated in the pop-up dialog when the entry is clicked on.
Maybe it would be more 'user friendly' to display the index entries lighter ?
On the one hand it is easier to read and on the other hand it consumes
less X11 resources by making the document much shorter.
I join an example how I did it.
If you find this feature useful
1) in insetindex.C:
LString InsetIndex::getScreenLabel() const
{
LString tmp;
// tmp = _("Index: ");
// tmp+=getContents();
tmp = _("");
return tmp;
}
2) in insetcommand.C
void InsetCommand::Draw(LyXFont font, LyXScreen &scr,
int baseline, float &x)
{
// Draw it as a box with the LaTeX text
//-------------------------------------------------- add
bool IamIndex = ( command == "index" ) ;
x += 3;
//scr.drawFilledRectangle(int(x), baseline - Ascent(font) + 1,
// Width(font) - 2, Ascent(font) + Descent(font)-2,
// FL_GRAY80);
//-------------------------------------------------- modif
if( ! IamIndex )
scr.fillRectangle(gc_lighted,
int(x)-2, baseline - Ascent(font) + 1,
Width(font) - 4,
Ascent(font) + Descent(font)-2);
// Tell whether this slows down the drawing (ale)
// lets draw editable and non-editable insets differently
if (Editable()) {
int y = baseline - Ascent(font)+1, w = Width(font)-6,
h = (Ascent(font)+Descent(font)-2);
//---------------------------- personal: I dont like heavy inset
buttons
// scr.drawFrame(FL_UP_FRAME, int(x), y, w, h, FL_BLACK, -1);
//-------------------------------------------------- modif
if( IamIndex ){
scr.drawLine(getGC( gc_foot ),
int(x)-2, baseline - Ascent(font)+2,
int(x),
baseline - Ascent(font)+5);
scr.drawLine(getGC( gc_foot ),
int(x)+1, baseline - Ascent(font),
int(x),
baseline - Ascent(font)+5);
}
} else {
//scr.drawRectangle(int(x), baseline - Ascent(font)+1,
// Width(font)-2, Ascent(font)+Descent(font)-2,
// FL_BLACK);
scr.drawRectangle(gc_note_frame,
int(x)-2, baseline - Ascent(font)+1,
Width(font)-4,
Ascent(font)+Descent(font)-2);
}
LString s = getScreenLabel();
LyXFont f = font;
f.decSize();
f.setColor(LyXFont::NONE);
f.setLatex(LyXFont::OFF);
scr.drawString(f, s, baseline, int(x+2));
x += Width(font) - 3;
}
Regards
Alex
--
MAKARENKO Address: Boeretang 280/67 B-2400 MOL Belgium
Alexandre Phones: (32)14-32.18.37 or (32)14-33.24.29
Fax: (32)14-32.05.13
E-mail: [EMAIL PROTECTED]
Http: http://www.sckcen.be:/~amakaren (under const)
SCK internal: http://pc785/

