mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-30 05:12:40 +00:00
* Leave page size at it is to avoid strange layout effects on Mac
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23473 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
9c05593876
commit
6da3d44268
@ -255,15 +255,16 @@ public:
|
|||||||
// Draw using the menu item style (this is how QComboBox does it).
|
// Draw using the menu item style (this is how QComboBox does it).
|
||||||
// But for the rich text drawing below we will call it with an
|
// But for the rich text drawing below we will call it with an
|
||||||
// empty string, and later then draw over it the real string.
|
// empty string, and later then draw over it the real string.
|
||||||
|
painter->save();
|
||||||
QStyleOptionMenuItem opt = getStyleOption(option, index);
|
QStyleOptionMenuItem opt = getStyleOption(option, index);
|
||||||
QString text = underlineFilter(opt.text);
|
QString text = underlineFilter(opt.text);
|
||||||
opt.text = QString();
|
opt.text = QString();
|
||||||
painter->eraseRect(option.rect);
|
painter->eraseRect(option.rect);
|
||||||
combo->style()->drawControl(QStyle::CE_MenuItem, &opt, painter, combo);
|
combo->style()->drawControl(QStyle::CE_MenuItem, &opt, painter, combo);
|
||||||
|
painter->restore();
|
||||||
|
|
||||||
// Draw the rich text.
|
// Draw the rich text.
|
||||||
painter->save();
|
painter->save();
|
||||||
|
|
||||||
QColor col = opt.palette.text().color();
|
QColor col = opt.palette.text().color();
|
||||||
if (opt.state & QStyle::State_Selected)
|
if (opt.state & QStyle::State_Selected)
|
||||||
col = opt.palette.highlightedText().color();
|
col = opt.palette.highlightedText().color();
|
||||||
@ -273,8 +274,7 @@ public:
|
|||||||
QTextDocument doc;
|
QTextDocument doc;
|
||||||
doc.setDefaultFont(opt.font);
|
doc.setDefaultFont(opt.font);
|
||||||
doc.setHtml(text);
|
doc.setHtml(text);
|
||||||
doc.setPageSize(QSize(opt.rect.width() - 20, opt.rect.height()));
|
painter->translate(opt.rect.x() + 20, opt.rect.y());
|
||||||
painter->translate(opt.rect.x() + 20, opt.rect.y() - opt.rect.height());
|
|
||||||
doc.documentLayout()->draw(painter, context);
|
doc.documentLayout()->draw(painter, context);
|
||||||
painter->restore();
|
painter->restore();
|
||||||
}
|
}
|
||||||
@ -358,7 +358,7 @@ public:
|
|||||||
void setCharFilter(QString const & f)
|
void setCharFilter(QString const & f)
|
||||||
{
|
{
|
||||||
setFilterRegExp(charFilterRegExp(f));
|
setFilterRegExp(charFilterRegExp(f));
|
||||||
reset();
|
dataChanged(index(0, 0), index(rowCount() - 1, 1));
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
Loading…
Reference in New Issue
Block a user