}
+// Mouse hover is not copied and remains empty
InsetExternal::InsetExternal(InsetExternal const & other)
: Inset(other),
boost::signals::trackable(),
InsetExternal::~InsetExternal()
{
hideDialogs("external", this);
+
+ map<BufferView const *, bool>::iterator it = mouse_hover_.begin();
+ map<BufferView const *, bool>::iterator end = mouse_hover_.end();
+ for (; it != end; ++it)
+ if (it->second)
+ it->first->clearLastInset(this);
+}
+
+
+bool InsetExternal::setMouseHover(BufferView const * bv, bool mouse_hover)
+{
+ mouse_hover_[bv] = mouse_hover;
+ return true;
}
void InsetExternal::draw(PainterInfo & pi, int x, int y) const
{
+ if (renderer_->asButton())
+ renderer_->setRenderState(mouse_hover_[pi.base.bv]);
renderer_->draw(pi, x, y);
}
int latex(odocstream &, OutputParams const &) const;
///
docstring contextMenu(BufferView const & bv, int x, int y) const;
+ ///
+ bool setMouseHover(BufferView const * bv, bool mouse_hover);
private:
///
InsetExternalParams params_;
/// The thing that actually draws the image on LyX's screen.
boost::scoped_ptr<RenderBase> renderer_;
+ /// changes color of the button when mouse enters/leaves this inset
+ mutable std::map<BufferView const *, bool> mouse_hover_;
};
} // namespace lyx