void InsetCommand::metrics(MetricsInfo & mi, Dimension & dim) const
{
- button_.update(screenLabel(), editable() != NOT_EDITABLE);
+ button_.update(screenLabel(), editable() || hasSettings());
button_.metrics(mi, dim);
}
break;
}
- case LFUN_MOUSE_RELEASE: {
- if (!cur.selection() && cmd.button() != mouse_button::button3)
- edit(cur, true);
- break;
- }
-
default:
Inset::doDispatch(cur, cmd);
break;
case LFUN_ERT_INSERT:
status.setEnabled(false);
return true;
+
// we handle these
case LFUN_INSET_MODIFY:
if (cmd.getArg(0) == "changetype") {
}
status.setEnabled(true);
return true;
+
case LFUN_INSET_DIALOG_UPDATE:
status.setEnabled(true);
return true;
+
default:
return Inset::getStatus(cur, cmd, status);
}
}
-void InsetCommand::edit(Cursor & cur, bool, EntryDirection)
+bool InsetCommand::showInsetDialog(BufferView * bv) const
{
if (!mailer_name_.empty())
- cur.bv().showDialog(mailer_name_, params2string(mailer_name_, p_), this);
+ bv->showDialog(mailer_name_, params2string(mailer_name_, p_),
+ const_cast<InsetCommand *>(this));
+ return true;
}