Add "Reset to Default" item to textstyle-apply button menu

Fixes: #5922.
This commit is contained in:
Juergen Spitzmueller 2018-12-27 14:16:38 +01:00
parent 2d876f8d9d
commit e704cc6e82

View File

@ -382,12 +382,17 @@ void DynamicMenuButton::updateTriggered()
default_act = act;
++i;
}
// Add item to reset to defaults
Action * dact = new Action(FuncRequest(LFUN_FONT_DEFAULT, FuncRequest::TOOLBAR), getIcon(FuncRequest(LFUN_UNDO), false),
qt_("&Reset to default"), qt_("Reset all font settings to their defaults"), this);
m->addAction(dact);
if (default_act) {
QToolButton::setDefaultAction(default_act);
QToolButton::setIcon(getIcon(FuncRequest(LFUN_TEXTSTYLE_APPLY), false));
}
setPopupMode(QToolButton::MenuButtonPopup);
setEnabled(lyx::getStatus(FuncRequest(LFUN_TEXTSTYLE_APPLY)).enabled());
setEnabled(lyx::getStatus(FuncRequest(LFUN_TEXTSTYLE_APPLY)).enabled()
|| lyx::getStatus(FuncRequest(LFUN_FONT_DEFAULT)).enabled());
} else if (menutype == "paste") {
m->clear();
docstring_list const sel = cap::availableSelections(&bv->buffer());