Greyedouts can be inserted in commands/description

This change also applies to Comment insets. For example, Greyedout
and comment insets can now be inserted in section titles.

The usage of these insets in commands relies on the newly
implemented cprotect feature. The usage of these insets in
description items already worked fine (without cprotect).

This commit also enables modification of these insets (e.g.,
converting a LyX note to a Greyedout note) in commands.

This commit is related to #6969.
This commit is contained in:
Scott Kostyshak 2018-04-19 12:16:23 -04:00
parent 80fe0dbe7e
commit 4e9e9881b2
2 changed files with 0 additions and 8 deletions

View File

@ -2911,11 +2911,6 @@ bool Text::getStatus(Cursor & cur, FuncRequest const & cmd,
}
case LFUN_NOTE_INSERT:
code = NOTE_CODE;
// in commands (sections etc.) and description items,
// only Notes are allowed
enable = (cmd.argument().empty() || cmd.getArg(0) == "Note" ||
(!cur.paragraph().layout().isCommand()
&& !inDescriptionItem(cur)));
break;
case LFUN_FLEX_INSERT: {
code = FLEX_CODE;

View File

@ -186,9 +186,6 @@ bool InsetNote::getStatus(Cursor & cur, FuncRequest const & cmd,
switch (cmd.action()) {
case LFUN_INSET_MODIFY:
// disallow comment and greyed out in commands
flag.setEnabled(!cur.paragraph().layout().isCommand() ||
cmd.getArg(2) == "Note");
if (cmd.getArg(0) == "note") {
InsetNoteParams params;
string2params(to_utf8(cmd.argument()), params);