mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-25 19:07:45 +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
|
href-insert.png
|
||||||
hidetab.png
|
hidetab.png
|
||||||
index-insert.png
|
index-insert.png
|
||||||
inset-insert_script_script_subscript.png
|
|
||||||
inset-insert_script_script_superscript.png
|
|
||||||
info-insert_buffer_vcs-revision.png
|
info-insert_buffer_vcs-revision.png
|
||||||
label-insert.png
|
label-insert.png
|
||||||
layout-document.png
|
layout-document.png
|
||||||
@ -1546,6 +1544,8 @@ lib_images_files = Split('''
|
|||||||
psnfss4.png
|
psnfss4.png
|
||||||
redo.png
|
redo.png
|
||||||
reload.png
|
reload.png
|
||||||
|
script-insert_subscript.png
|
||||||
|
script-insert_superscript.png
|
||||||
split-view_horizontal.png
|
split-view_horizontal.png
|
||||||
split-view_vertical.png
|
split-view_vertical.png
|
||||||
standard.png
|
standard.png
|
||||||
|
@ -381,8 +381,6 @@ dist_images_DATA = \
|
|||||||
images/hidetab.png \
|
images/hidetab.png \
|
||||||
images/index-insert.png \
|
images/index-insert.png \
|
||||||
images/info-insert_buffer_vcs-revision.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/label-insert.png \
|
||||||
images/layout.png \
|
images/layout.png \
|
||||||
images/layout-document.png \
|
images/layout-document.png \
|
||||||
@ -425,6 +423,8 @@ dist_images_DATA = \
|
|||||||
images/psnfss4.png \
|
images/psnfss4.png \
|
||||||
images/redo.png \
|
images/redo.png \
|
||||||
images/reload.png \
|
images/reload.png \
|
||||||
|
images/script-insert_subscript.png \
|
||||||
|
images/script-insert_superscript.png \
|
||||||
images/split-view_horizontal.png \
|
images/split-view_horizontal.png \
|
||||||
images/split-view_vertical.png \
|
images/split-view_vertical.png \
|
||||||
images/standard.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
|
End
|
||||||
|
|
||||||
Menu "insert_formatting"
|
Menu "insert_formatting"
|
||||||
Item "Superscript|S" "inset-insert script script superscript"
|
Item "Superscript|S" "script-insert superscript"
|
||||||
Item "Subscript|u" "inset-insert script script subscript"
|
Item "Subscript|u" "script-insert subscript"
|
||||||
Separator
|
Separator
|
||||||
Item "Protected Space|P" "space-insert protected"
|
Item "Protected Space|P" "space-insert protected"
|
||||||
Item "Interword Space|w" "space-insert normal"
|
Item "Interword Space|w" "space-insert normal"
|
||||||
|
@ -447,6 +447,8 @@ enum FuncCode
|
|||||||
LFUN_SPELLING_REMOVE, // switt 20100728
|
LFUN_SPELLING_REMOVE, // switt 20100728
|
||||||
LFUN_PREVIEW_INSERT, // vfr, 20100328
|
LFUN_PREVIEW_INSERT, // vfr, 20100328
|
||||||
LFUN_FORWARD_SEARCH,
|
LFUN_FORWARD_SEARCH,
|
||||||
|
LFUN_SCRIPT_INSERT, // gb, 20101123
|
||||||
|
// 350
|
||||||
|
|
||||||
LFUN_LASTACTION // end of the table
|
LFUN_LASTACTION // end of the table
|
||||||
};
|
};
|
||||||
|
@ -502,6 +502,15 @@ void LyXAction::init()
|
|||||||
* \endvar
|
* \endvar
|
||||||
*/
|
*/
|
||||||
{ LFUN_SPECIALCHAR_INSERT, "specialchar-insert", Noop, Edit },
|
{ 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
|
* \var lyx::FuncCode lyx::LFUN_APPENDIX
|
||||||
* \li Action: Start (or remove) Appendix on the given cursor position.
|
* \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_ARGUMENT_INSERT:
|
||||||
case LFUN_INDEX_INSERT:
|
case LFUN_INDEX_INSERT:
|
||||||
case LFUN_PREVIEW_INSERT:
|
case LFUN_PREVIEW_INSERT:
|
||||||
|
case LFUN_SCRIPT_INSERT:
|
||||||
// Open the inset, and move the current selection
|
// Open the inset, and move the current selection
|
||||||
// inside it.
|
// inside it.
|
||||||
doInsertInset(cur, this, cmd, true, true);
|
doInsertInset(cur, this, cmd, true, true);
|
||||||
@ -2453,6 +2454,9 @@ bool Text::getStatus(Cursor & cur, FuncRequest const & cmd,
|
|||||||
case LFUN_PREVIEW_INSERT:
|
case LFUN_PREVIEW_INSERT:
|
||||||
code = PREVIEW_CODE;
|
code = PREVIEW_CODE;
|
||||||
break;
|
break;
|
||||||
|
case LFUN_SCRIPT_INSERT:
|
||||||
|
code = SCRIPT_CODE;
|
||||||
|
break;
|
||||||
|
|
||||||
case LFUN_MATH_INSERT:
|
case LFUN_MATH_INSERT:
|
||||||
case LFUN_MATH_AMS_MATRIX:
|
case LFUN_MATH_AMS_MATRIX:
|
||||||
|
@ -210,6 +210,12 @@ Inset * createInsetHelper(Buffer * buf, FuncRequest const & cmd)
|
|||||||
case LFUN_PREVIEW_INSERT:
|
case LFUN_PREVIEW_INSERT:
|
||||||
return new InsetPreview(buf);
|
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: {
|
case LFUN_INSET_INSERT: {
|
||||||
string const name = cmd.getArg(0);
|
string const name = cmd.getArg(0);
|
||||||
InsetCode code = insetCode(name);
|
InsetCode code = insetCode(name);
|
||||||
|
@ -1384,6 +1384,7 @@ bool InsetMathNest::getStatus(Cursor & cur, FuncRequest const & cmd,
|
|||||||
}
|
}
|
||||||
|
|
||||||
case LFUN_SPECIALCHAR_INSERT:
|
case LFUN_SPECIALCHAR_INSERT:
|
||||||
|
case LFUN_SCRIPT_INSERT:
|
||||||
// FIXME: These would probably make sense in math-text mode
|
// FIXME: These would probably make sense in math-text mode
|
||||||
flag.setEnabled(false);
|
flag.setEnabled(false);
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user