mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-22 01:59:02 +00:00
Fix inserting subscript/superscript with nonempty selection by creating a dedicated lfun:
inset-insert simply swallows the selection, while box-insert, note-insert etc. put the selection inside the new inset. As a side effect the toolbar icons get better names, as requested by Uwe. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36451 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
f53a16e328
commit
7edd656f21
@ -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
|
||||
|
@ -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 \
|
||||
|
Before Width: | Height: | Size: 188 B After Width: | Height: | Size: 188 B |
Before Width: | Height: | Size: 192 B After Width: | Height: | Size: 192 B |
@ -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"
|
||||
|
@ -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
|
||||
};
|
||||
|
@ -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 <TYPE>
|
||||
* \li Params: <TYPE>: 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.
|
||||
|
@ -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:
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user