diff --git a/src/insets/ChangeLog b/src/insets/ChangeLog index c5179afb1f..65e8ec9b0c 100644 --- a/src/insets/ChangeLog +++ b/src/insets/ChangeLog @@ -1,3 +1,12 @@ +2004-08-14 Jean-Marc Lasgouttes + + * insetinclude.C (priv_dispatch): fix showing dialog on mouse + release + (metrics): the insets is not full width any more. + (draw): adjust; fix bad test for PREVIEW_OFF + (add_preview): fix bad test for PREVIEW_OFF + (display): do not return true when using \input + 2004-08-14 José Matos * insetbibitem.[Ch] (plaintext): added. diff --git a/src/insets/insetinclude.C b/src/insets/insetinclude.C index a8bd6600b9..5d668a71aa 100644 --- a/src/insets/insetinclude.C +++ b/src/insets/insetinclude.C @@ -138,10 +138,6 @@ void InsetInclude::priv_dispatch(LCursor & cur, FuncRequest & cmd) break; case LFUN_MOUSE_RELEASE: - if (button_.box().contains(cmd.x, cmd.y)) - InsetIncludeMailer(*this).showDialog(&cur.bv()); - break; - case LFUN_INSET_DIALOG_SHOW: InsetIncludeMailer(*this).showDialog(&cur.bv()); break; @@ -604,16 +600,14 @@ void InsetInclude::metrics(MetricsInfo & mi, Dimension & dim) const if (!set_label_) { set_label_ = true; button_.update(getScreenLabel(*mi.base.bv->buffer()), - editable() != NOT_EDITABLE); + true); } button_.metrics(mi, dim); } - int center_indent = type(params_) == INPUT ? - 0 : (mi.base.textwidth - dim.wid) / 2; - Box b(center_indent, center_indent + dim.wid, -dim.asc, dim.des); + + Box b(0, dim.wid, -dim.asc, dim.des); button_.setBox(b); - dim.wid = mi.base.textwidth; dim_ = dim; } @@ -625,18 +619,24 @@ void InsetInclude::draw(PainterInfo & pi, int x, int y) const BOOST_ASSERT(pi.base.bv && pi.base.bv->buffer()); bool use_preview = false; - if (RenderPreview::status() == LyXRC::PREVIEW_OFF) { + if (RenderPreview::status() != LyXRC::PREVIEW_OFF) { lyx::graphics::PreviewImage const * pimage = preview_->getPreviewImage(*pi.base.bv->buffer()); use_preview = pimage && pimage->image(); } if (use_preview) - preview_->draw(pi, x + button_.box().x1, y); + preview_->draw(pi, x, y); else - button_.draw(pi, x + button_.box().x1, y); + button_.draw(pi, x, y); } +bool InsetInclude::display() const +{ + return type(params_) != INPUT; +} + + // // preview stuff @@ -681,7 +681,7 @@ void add_preview(RenderMonitoredPreview & renderer, InsetInclude const & inset, Buffer const & buffer) { InsetCommandParams const & params = inset.params(); - if (RenderPreview::status() == LyXRC::PREVIEW_OFF && + if (RenderPreview::status() != LyXRC::PREVIEW_OFF && preview_wanted(params, buffer)) { renderer.setAbsFile(includedFilename(buffer, params)); string const snippet = latex_string(inset, buffer); diff --git a/src/insets/insetinclude.h b/src/insets/insetinclude.h index 588d5eabe2..b0aae9d27f 100644 --- a/src/insets/insetinclude.h +++ b/src/insets/insetinclude.h @@ -39,7 +39,7 @@ public: /// void draw(PainterInfo & pi, int x, int y) const; /// - virtual bool display() const { return true; } + virtual bool display() const; /// get the parameters InsetCommandParams const & params(void) const;