mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-25 05:55:34 +00:00
Inset configurability: separate charstyle and custom insets
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19769 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
2cf5e9b563
commit
540f3564f0
19
lib/layouts/stdcustom.inc
Normal file
19
lib/layouts/stdcustom.inc
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
# Textclass definition file for LaTeX.
|
||||||
|
# Author : Martin vermeer <amrtin.vermeer@tkk.fi>
|
||||||
|
# Custom Inset layouts definition
|
||||||
|
|
||||||
|
Format 5
|
||||||
|
|
||||||
|
InsetLayout Custom:Endnote
|
||||||
|
LyXType custom
|
||||||
|
LatexName endnote
|
||||||
|
LatexType command
|
||||||
|
Font
|
||||||
|
Size Small
|
||||||
|
EndFont
|
||||||
|
LabelString foot
|
||||||
|
Preamble
|
||||||
|
\usepackage{endnote}
|
||||||
|
EndPreamble
|
||||||
|
End
|
||||||
|
|
@ -295,6 +295,7 @@ Menuset
|
|||||||
Submenu "Float|a" "insert_float"
|
Submenu "Float|a" "insert_float"
|
||||||
Submenu "Note|N" "insert_note"
|
Submenu "Note|N" "insert_note"
|
||||||
Submenu "Branch|B" "insert_branches"
|
Submenu "Branch|B" "insert_branches"
|
||||||
|
Submenu "Custom insets" "insert_custom"
|
||||||
Submenu "File|e" "insert_file"
|
Submenu "File|e" "insert_file"
|
||||||
Item "Box" "box-insert Frameless"
|
Item "Box" "box-insert Frameless"
|
||||||
Separator
|
Separator
|
||||||
@ -404,6 +405,10 @@ Menuset
|
|||||||
Branches
|
Branches
|
||||||
End
|
End
|
||||||
|
|
||||||
|
Menu "insert_custom"
|
||||||
|
Custom
|
||||||
|
End
|
||||||
|
|
||||||
#
|
#
|
||||||
# DOCUMENT MENU
|
# DOCUMENT MENU
|
||||||
#
|
#
|
||||||
|
@ -218,6 +218,7 @@ Menu & Menu::read(Lexer & lex)
|
|||||||
md_documents,
|
md_documents,
|
||||||
md_bookmarks,
|
md_bookmarks,
|
||||||
md_charstyles,
|
md_charstyles,
|
||||||
|
md_custom,
|
||||||
md_endmenu,
|
md_endmenu,
|
||||||
md_exportformats,
|
md_exportformats,
|
||||||
md_importformats,
|
md_importformats,
|
||||||
@ -240,6 +241,7 @@ Menu & Menu::read(Lexer & lex)
|
|||||||
{ "bookmarks", md_bookmarks },
|
{ "bookmarks", md_bookmarks },
|
||||||
{ "branches", md_branches },
|
{ "branches", md_branches },
|
||||||
{ "charstyles", md_charstyles },
|
{ "charstyles", md_charstyles },
|
||||||
|
{ "custom", md_custom },
|
||||||
{ "documents", md_documents },
|
{ "documents", md_documents },
|
||||||
{ "end", md_endmenu },
|
{ "end", md_endmenu },
|
||||||
{ "exportformats", md_exportformats },
|
{ "exportformats", md_exportformats },
|
||||||
@ -294,6 +296,10 @@ Menu & Menu::read(Lexer & lex)
|
|||||||
add(MenuItem(MenuItem::CharStyles));
|
add(MenuItem(MenuItem::CharStyles));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case md_custom:
|
||||||
|
add(MenuItem(MenuItem::Custom));
|
||||||
|
break;
|
||||||
|
|
||||||
case md_documents:
|
case md_documents:
|
||||||
add(MenuItem(MenuItem::Documents));
|
add(MenuItem(MenuItem::Documents));
|
||||||
break;
|
break;
|
||||||
@ -613,7 +619,7 @@ void expandFloatInsert(Menu & tomenu, Buffer const * buf)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void expandCharStyleInsert(Menu & tomenu, Buffer const * buf)
|
void expandCharStyleInsert(Menu & tomenu, Buffer const * buf, std::string s)
|
||||||
{
|
{
|
||||||
if (!buf) {
|
if (!buf) {
|
||||||
tomenu.add(MenuItem(MenuItem::Command,
|
tomenu.add(MenuItem(MenuItem::Command,
|
||||||
@ -627,8 +633,9 @@ void expandCharStyleInsert(Menu & tomenu, Buffer const * buf)
|
|||||||
CharStyles::iterator end = charstyles.end();
|
CharStyles::iterator end = charstyles.end();
|
||||||
for (; cit != end; ++cit) {
|
for (; cit != end; ++cit) {
|
||||||
docstring const label = from_utf8(cit->name);
|
docstring const label = from_utf8(cit->name);
|
||||||
tomenu.addWithStatusCheck(MenuItem(MenuItem::Command, label,
|
if (cit->lyxtype == s)
|
||||||
FuncRequest(LFUN_CHARSTYLE_INSERT,
|
tomenu.addWithStatusCheck(MenuItem(MenuItem::Command,
|
||||||
|
label, FuncRequest(LFUN_CHARSTYLE_INSERT,
|
||||||
label)));
|
label)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -877,7 +884,11 @@ void MenuBackend::expand(Menu const & frommenu, Menu & tomenu,
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case MenuItem::CharStyles:
|
case MenuItem::CharStyles:
|
||||||
expandCharStyleInsert(tomenu, buf);
|
expandCharStyleInsert(tomenu, buf, "charstyle");
|
||||||
|
break;
|
||||||
|
|
||||||
|
case MenuItem::Custom:
|
||||||
|
expandCharStyleInsert(tomenu, buf, "custom");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MenuItem::FloatListInsert:
|
case MenuItem::FloatListInsert:
|
||||||
|
@ -63,6 +63,9 @@ public:
|
|||||||
/** This is the list of elements available
|
/** This is the list of elements available
|
||||||
* for insertion into document. */
|
* for insertion into document. */
|
||||||
CharStyles,
|
CharStyles,
|
||||||
|
/** This is the list of user-configurable
|
||||||
|
insets to insert into document */
|
||||||
|
Custom,
|
||||||
/** This is the list of floats that we can
|
/** This is the list of floats that we can
|
||||||
insert a list for. */
|
insert a list for. */
|
||||||
FloatListInsert,
|
FloatListInsert,
|
||||||
|
@ -698,7 +698,7 @@ void TextClass::readInsetLayout(Lexer & lexrc, docstring const & name)
|
|||||||
insetlayoutlist_[name] = il;
|
insetlayoutlist_[name] = il;
|
||||||
|
|
||||||
// test name for CS:
|
// test name for CS:
|
||||||
if (il.lyxtype == "charstyle") {
|
if (il.lyxtype == "charstyle" || il.lyxtype == "custom") {
|
||||||
charstyles().push_back(il);
|
charstyles().push_back(il);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user