+InsetCommand::~InsetCommand()
+{
+ if (!mailer_name_.empty())
+ InsetCommandMailer(mailer_name_, *this).hideDialog();
+}
+
+
+bool InsetCommand::metrics(MetricsInfo & mi, Dimension & dim) const
+{
+ if (updateButtonLabel_) {
+ updateButtonLabel_ = false;
+ button_.update(getScreenLabel(*mi.base.bv->buffer()),
+ editable() != NOT_EDITABLE);
+ }
+ button_.metrics(mi, dim);
+ bool const changed = dim_ != dim;
+ dim_ = dim;
+ return changed;
+}
+
+
+bool InsetCommand::setMouseHover(bool mouse_hover)
+{
+ mouse_hover_ = mouse_hover;
+ return true;
+}
+
+
+void InsetCommand::draw(PainterInfo & pi, int x, int y) const
+{
+ setPosCache(pi, x, y);
+ button_.setRenderState(mouse_hover_);
+ button_.draw(pi, x, y);
+}
+
+