diff --git a/development/scons/scons_manifest.py b/development/scons/scons_manifest.py index e549f0572a..4397b7670e 100644 --- a/development/scons/scons_manifest.py +++ b/development/scons/scons_manifest.py @@ -1501,8 +1501,6 @@ lib_images_files = Split(''' href-insert.png hidetab.png index-insert.png - inset-insert_script_script_subscript.png - inset-insert_script_script_superscript.png info-insert_buffer_vcs-revision.png label-insert.png layout-document.png @@ -1546,6 +1544,8 @@ lib_images_files = Split(''' psnfss4.png redo.png reload.png + script-insert_subscript.png + script-insert_superscript.png split-view_horizontal.png split-view_vertical.png standard.png diff --git a/lib/Makefile.am b/lib/Makefile.am index 097cfc62ca..aa8b33404b 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -381,8 +381,6 @@ dist_images_DATA = \ images/hidetab.png \ images/index-insert.png \ images/info-insert_buffer_vcs-revision.png \ - images/inset-insert_script_script_subscript.png \ - images/inset-insert_script_script_superscript.png \ images/label-insert.png \ images/layout.png \ images/layout-document.png \ @@ -425,6 +423,8 @@ dist_images_DATA = \ images/psnfss4.png \ images/redo.png \ images/reload.png \ + images/script-insert_subscript.png \ + images/script-insert_superscript.png \ images/split-view_horizontal.png \ images/split-view_vertical.png \ images/standard.png \ diff --git a/lib/images/inset-insert_script_script_subscript.png b/lib/images/script-insert_subscript.png similarity index 100% rename from lib/images/inset-insert_script_script_subscript.png rename to lib/images/script-insert_subscript.png diff --git a/lib/images/inset-insert_script_script_superscript.png b/lib/images/script-insert_superscript.png similarity index 100% rename from lib/images/inset-insert_script_script_superscript.png rename to lib/images/script-insert_superscript.png diff --git a/lib/ui/stdmenus.inc b/lib/ui/stdmenus.inc index 38f25e59ed..beb2472200 100644 --- a/lib/ui/stdmenus.inc +++ b/lib/ui/stdmenus.inc @@ -385,8 +385,8 @@ Menuset End Menu "insert_formatting" - Item "Superscript|S" "inset-insert script script superscript" - Item "Subscript|u" "inset-insert script script subscript" + Item "Superscript|S" "script-insert superscript" + Item "Subscript|u" "script-insert subscript" Separator Item "Protected Space|P" "space-insert protected" Item "Interword Space|w" "space-insert normal" diff --git a/src/FuncCode.h b/src/FuncCode.h index 746d88c424..cd2d289a89 100644 --- a/src/FuncCode.h +++ b/src/FuncCode.h @@ -447,6 +447,8 @@ enum FuncCode LFUN_SPELLING_REMOVE, // switt 20100728 LFUN_PREVIEW_INSERT, // vfr, 20100328 LFUN_FORWARD_SEARCH, + LFUN_SCRIPT_INSERT, // gb, 20101123 + // 350 LFUN_LASTACTION // end of the table }; diff --git a/src/LyXAction.cpp b/src/LyXAction.cpp index 35d2c1ab77..490da88a53 100644 --- a/src/LyXAction.cpp +++ b/src/LyXAction.cpp @@ -502,6 +502,15 @@ void LyXAction::init() * \endvar */ { LFUN_SPECIALCHAR_INSERT, "specialchar-insert", Noop, Edit }, +/*! + * \var lyx::FuncCode lyx::LFUN_SCRIPT_INSERT + * \li Action: Inserts a subscript or superscript inset. + * \li Syntax: script-insert + * \li Params: : subscript|superscript + * \li Origin: gb, 23 Nov 2010 + * \endvar + */ + { LFUN_SCRIPT_INSERT, "script-insert", Noop, Edit }, /*! * \var lyx::FuncCode lyx::LFUN_APPENDIX * \li Action: Start (or remove) Appendix on the given cursor position. diff --git a/src/Text3.cpp b/src/Text3.cpp index 31273be75e..bc1ef41b18 100644 --- a/src/Text3.cpp +++ b/src/Text3.cpp @@ -1619,6 +1619,7 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd) case LFUN_ARGUMENT_INSERT: case LFUN_INDEX_INSERT: case LFUN_PREVIEW_INSERT: + case LFUN_SCRIPT_INSERT: // Open the inset, and move the current selection // inside it. doInsertInset(cur, this, cmd, true, true); @@ -2453,6 +2454,9 @@ bool Text::getStatus(Cursor & cur, FuncRequest const & cmd, case LFUN_PREVIEW_INSERT: code = PREVIEW_CODE; break; + case LFUN_SCRIPT_INSERT: + code = SCRIPT_CODE; + break; case LFUN_MATH_INSERT: case LFUN_MATH_AMS_MATRIX: diff --git a/src/factory.cpp b/src/factory.cpp index d763e52f5b..5796edb1d5 100644 --- a/src/factory.cpp +++ b/src/factory.cpp @@ -210,6 +210,12 @@ Inset * createInsetHelper(Buffer * buf, FuncRequest const & cmd) case LFUN_PREVIEW_INSERT: return new InsetPreview(buf); + case LFUN_SCRIPT_INSERT: { + InsetScriptParams isp; + InsetScript::string2params("script script " + to_utf8(cmd.argument()), isp); + return new InsetScript(buf, isp); + } + case LFUN_INSET_INSERT: { string const name = cmd.getArg(0); InsetCode code = insetCode(name); diff --git a/src/mathed/InsetMathNest.cpp b/src/mathed/InsetMathNest.cpp index 7ed16911cc..ec01f08c29 100644 --- a/src/mathed/InsetMathNest.cpp +++ b/src/mathed/InsetMathNest.cpp @@ -1384,6 +1384,7 @@ bool InsetMathNest::getStatus(Cursor & cur, FuncRequest const & cmd, } case LFUN_SPECIALCHAR_INSERT: + case LFUN_SCRIPT_INSERT: // FIXME: These would probably make sense in math-text mode flag.setEnabled(false); break;