string const & mailer_name)
: p_(p.getCmdName(), p.getContents(), p.getOptions(), p.getSecOptions()),
mailer_name_(mailer_name),
- set_label_(false)
+ updateButtonLabel_(true)
{}
void InsetCommand::metrics(MetricsInfo & mi, Dimension & dim) const
{
- if (!set_label_) {
- set_label_ = true;
+ if (updateButtonLabel_) {
+ updateButtonLabel_ = false;
button_.update(getScreenLabel(*mi.base.bv->buffer()),
editable() != NOT_EDITABLE);
}
void InsetCommand::setParams(InsetCommandParams const & p)
{
p_ = p;
- set_label_ = false;
+ updateButtonLabel_ = true;
}
{
switch (cmd.action) {
case LFUN_INSET_REFRESH:
- set_label_ = false;
+ updateButtonLabel_ = true;
break;
case LFUN_INSET_MODIFY: {
InsetCommandParams p;
InsetCommandMailer::string2params(mailer_name_, cmd.argument, p);
- if (p.getCmdName().empty()) {
- cur.undispatched();
- } else {
+ if (p.getCmdName().empty())
+ cur.noUpdate();
+ else
setParams(p);
- cur.bv().update();
- }
break;
}