mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-29 05:01:49 +00:00
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:
parent
80fe0dbe7e
commit
4e9e9881b2
@ -2911,11 +2911,6 @@ bool Text::getStatus(Cursor & cur, FuncRequest const & cmd,
|
|||||||
}
|
}
|
||||||
case LFUN_NOTE_INSERT:
|
case LFUN_NOTE_INSERT:
|
||||||
code = NOTE_CODE;
|
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;
|
break;
|
||||||
case LFUN_FLEX_INSERT: {
|
case LFUN_FLEX_INSERT: {
|
||||||
code = FLEX_CODE;
|
code = FLEX_CODE;
|
||||||
|
@ -186,9 +186,6 @@ bool InsetNote::getStatus(Cursor & cur, FuncRequest const & cmd,
|
|||||||
switch (cmd.action()) {
|
switch (cmd.action()) {
|
||||||
|
|
||||||
case LFUN_INSET_MODIFY:
|
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") {
|
if (cmd.getArg(0) == "note") {
|
||||||
InsetNoteParams params;
|
InsetNoteParams params;
|
||||||
string2params(to_utf8(cmd.argument()), params);
|
string2params(to_utf8(cmd.argument()), params);
|
||||||
|
Loading…
Reference in New Issue
Block a user