mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-27 03:36:39 +00:00
* first step to proper RTL support of the completion. The cursor is still wrong.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23130 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
aa532e094f
commit
7b0ea48d31
@ -766,6 +766,10 @@ void RowPainter::paintText()
|
||||
x_ += row_.label_hfill + lwidth - width_pos;
|
||||
}
|
||||
|
||||
// Is the inline completion in front of character?
|
||||
if (font.isRightToLeft() && vpos == inlineCompletionVPos_)
|
||||
paintInlineCompletion(vpos, font);
|
||||
|
||||
if (par_.isSeparator(pos)) {
|
||||
Font const orig_font = text_metrics_.getDisplayFont(pit_, pos);
|
||||
double const orig_x = x_;
|
||||
@ -786,12 +790,33 @@ void RowPainter::paintText()
|
||||
paintFromPos(vpos);
|
||||
}
|
||||
|
||||
// Is the inline completion here?
|
||||
// FIXME: RTL support needed here
|
||||
if (vpos - 1 == inlineCompletionVPos_) {
|
||||
docstring const & completion = pi_.base.bv->inlineCompletion();
|
||||
// Is the inline completion after character?
|
||||
if (!font.isRightToLeft() && vpos - 1 == inlineCompletionVPos_)
|
||||
paintInlineCompletion(vpos, font);
|
||||
}
|
||||
|
||||
// if we reach the end of a struck out range, paint it
|
||||
if (running_strikeout) {
|
||||
// calculate 1/3 height of the buffer's default font
|
||||
FontMetrics const & fm
|
||||
= theFontMetrics(pi_.base.bv->buffer().params().getFont());
|
||||
int const middle = yo_ - fm.maxAscent() / 3;
|
||||
pi_.pain.line(last_strikeout_x, middle, int(x_), middle,
|
||||
Color_deletedtext, Painter::line_solid, Painter::line_thin);
|
||||
running_strikeout = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void RowPainter::paintInlineCompletion(pos_type & vpos, Font const & font)
|
||||
{
|
||||
docstring completion = pi_.base.bv->inlineCompletion();
|
||||
FontInfo f = font.fontInfo();
|
||||
|
||||
// right to left?
|
||||
if (font.isRightToLeft())
|
||||
reverse(completion.begin(), completion.end());
|
||||
|
||||
// draw the unique and the non-unique completion part
|
||||
// Note: this is not time-critical as it is
|
||||
// only done once per screen.
|
||||
@ -811,18 +836,5 @@ void RowPainter::paintText()
|
||||
x_ += theFontMetrics(font).width(s2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// if we reach the end of a struck out range, paint it
|
||||
if (running_strikeout) {
|
||||
// calculate 1/3 height of the buffer's default font
|
||||
FontMetrics const & fm
|
||||
= theFontMetrics(pi_.base.bv->buffer().params().getFont());
|
||||
int const middle = yo_ - fm.maxAscent() / 3;
|
||||
pi_.pain.line(last_strikeout_x, middle, int(x_), middle,
|
||||
Color_deletedtext, Painter::line_solid, Painter::line_thin);
|
||||
running_strikeout = false;
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace lyx
|
||||
|
@ -63,6 +63,7 @@ private:
|
||||
int paintAppendixStart(int y);
|
||||
void paintFromPos(pos_type & vpos);
|
||||
void paintInset(Inset const * inset, pos_type const pos);
|
||||
void paintInlineCompletion(pos_type & vpos, Font const & font);
|
||||
|
||||
/// return left margin
|
||||
int leftMargin() const;
|
||||
|
Loading…
Reference in New Issue
Block a user