mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-22 18:08:10 +00:00
A little further clean-up.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7895 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
dff822442a
commit
1c4ae33f9a
@ -1,3 +1,10 @@
|
||||
2003-10-10 Angus Leeming <leeming@lyx.org>
|
||||
|
||||
* insetinclude.C (metrics): use preview_->metrics.
|
||||
(draw): use preview_->draw.
|
||||
|
||||
* render_preview.[Ch] (pimage): removed.
|
||||
|
||||
2003-10-10 Angus Leeming <leeming@lyx.org>
|
||||
|
||||
* renderers.[Ch]: removed.
|
||||
|
@ -519,9 +519,7 @@ void InsetInclude::fillWithBibKeys(Buffer const & buffer,
|
||||
void InsetInclude::metrics(MetricsInfo & mi, Dimension & dim) const
|
||||
{
|
||||
if (preview_->previewReady()) {
|
||||
dim.asc = preview_->pimage()->ascent();
|
||||
dim.des = preview_->pimage()->descent();
|
||||
dim.wid = preview_->pimage()->width();
|
||||
preview_->metrics(mi, dim);
|
||||
} else {
|
||||
if (!set_label_) {
|
||||
set_label_ = true;
|
||||
@ -555,8 +553,7 @@ void InsetInclude::draw(PainterInfo & pi, int x, int y) const
|
||||
preview_->startMonitoring(included_file);
|
||||
}
|
||||
|
||||
pi.pain.image(x + button_.box().x1, y - dim_.asc, dim_.wid, dim_.height(),
|
||||
*(preview_->pimage()->image()));
|
||||
preview_->draw(pi, x + button_.box().x1, y);
|
||||
}
|
||||
|
||||
|
||||
|
@ -60,9 +60,9 @@ RenderBase * RenderPreview::clone() const
|
||||
void RenderPreview::metrics(MetricsInfo &, Dimension & dim) const
|
||||
{
|
||||
if (previewReady()) {
|
||||
dim.asc = pimage()->ascent();
|
||||
dim.des = pimage()->descent();
|
||||
dim.wid = pimage()->width();
|
||||
dim.asc = pimage_->ascent();
|
||||
dim.des = pimage_->descent();
|
||||
dim.wid = pimage_->width();
|
||||
} else {
|
||||
dim.asc = 20;
|
||||
dim.des = 20;
|
||||
@ -75,15 +75,12 @@ void RenderPreview::metrics(MetricsInfo &, Dimension & dim) const
|
||||
|
||||
void RenderPreview::draw(PainterInfo & pi, int x, int y) const
|
||||
{
|
||||
BOOST_ASSERT(pi.base.bv);
|
||||
view_ = pi.base.bv->owner()->view();
|
||||
|
||||
if (!previewReady())
|
||||
pi.pain.rectangle(x, y - dim_.asc, dim_.wid, dim_.height(),
|
||||
LColor::foreground);
|
||||
else
|
||||
pi.pain.image(x, y - dim_.asc, dim_.wid, dim_.height(),
|
||||
*(pimage()->image()));
|
||||
*(pimage_->image()));
|
||||
}
|
||||
|
||||
|
||||
|
@ -73,10 +73,6 @@ public:
|
||||
/// The preview has been generated and is ready to use.
|
||||
bool previewReady() const;
|
||||
|
||||
/// If the preview is not ready, returns 0.
|
||||
lyx::graphics::PreviewImage const * const pimage() const
|
||||
{ return pimage_; }
|
||||
|
||||
/// Connect and you'll be informed when the preview is ready.
|
||||
typedef boost::signal0<void>::slot_type slot_type;
|
||||
boost::signals::connection connect(slot_type const &);
|
||||
|
Loading…
Reference in New Issue
Block a user