mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-25 22:06:15 +00:00
Add button for default layout to the toolbar
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15946 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
f5979da1d2
commit
bb8c9253e4
@ -1470,6 +1470,7 @@ lib_images_files = Split('''
|
|||||||
footnote-insert.xpm
|
footnote-insert.xpm
|
||||||
index-insert.xpm
|
index-insert.xpm
|
||||||
label-insert.xpm
|
label-insert.xpm
|
||||||
|
layout.xpm
|
||||||
layout-document.xpm
|
layout-document.xpm
|
||||||
layout-paragraph.xpm
|
layout-paragraph.xpm
|
||||||
layout_Description.xpm
|
layout_Description.xpm
|
||||||
|
@ -203,6 +203,7 @@ dist_images_DATA = \
|
|||||||
images/footnote-insert.xpm \
|
images/footnote-insert.xpm \
|
||||||
images/index-insert.xpm \
|
images/index-insert.xpm \
|
||||||
images/label-insert.xpm \
|
images/label-insert.xpm \
|
||||||
|
images/layout.xpm \
|
||||||
images/layout-document.xpm \
|
images/layout-document.xpm \
|
||||||
images/layout-paragraph.xpm \
|
images/layout-paragraph.xpm \
|
||||||
images/layout_Description.xpm \
|
images/layout_Description.xpm \
|
||||||
|
25
lib/images/layout.xpm
Normal file
25
lib/images/layout.xpm
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
/* XPM */
|
||||||
|
static char * layout_xpm[] = {
|
||||||
|
"20 20 2 1",
|
||||||
|
" c None",
|
||||||
|
". c #000000",
|
||||||
|
" ",
|
||||||
|
" ",
|
||||||
|
" ................. ",
|
||||||
|
" ",
|
||||||
|
" ",
|
||||||
|
" ................. ",
|
||||||
|
" ",
|
||||||
|
" ",
|
||||||
|
" ................. ",
|
||||||
|
" ",
|
||||||
|
" ",
|
||||||
|
" ................. ",
|
||||||
|
" ",
|
||||||
|
" ",
|
||||||
|
" ................. ",
|
||||||
|
" ",
|
||||||
|
" ",
|
||||||
|
" ................. ",
|
||||||
|
" ",
|
||||||
|
" "};
|
@ -63,6 +63,7 @@ Toolbar "standard" "Standard"
|
|||||||
End
|
End
|
||||||
|
|
||||||
Toolbar "extra" "Extra"
|
Toolbar "extra" "Extra"
|
||||||
|
Item "Default" "layout"
|
||||||
Item "Numbered list" "layout Enumerate"
|
Item "Numbered list" "layout Enumerate"
|
||||||
Item "Itemized list" "layout Itemize"
|
Item "Itemized list" "layout Itemize"
|
||||||
Item "List" "layout List"
|
Item "List" "layout List"
|
||||||
|
19
src/text3.C
19
src/text3.C
@ -809,24 +809,15 @@ void LyXText::dispatch(LCursor & cur, FuncRequest & cmd)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case LFUN_LAYOUT: {
|
case LFUN_LAYOUT: {
|
||||||
lyxerr[Debug::INFO] << "LFUN_LAYOUT: (arg) "
|
string layout = to_ascii(cmd.argument());
|
||||||
<< to_utf8(cmd.argument()) << endl;
|
lyxerr[Debug::INFO] << "LFUN_LAYOUT: (arg) " << layout << endl;
|
||||||
|
|
||||||
// This is not the good solution to the empty argument
|
|
||||||
// problem, but it will hopefully suffice for 1.2.0.
|
|
||||||
// The correct solution would be to augument the
|
|
||||||
// function list/array with information about what
|
|
||||||
// functions needs arguments and their type.
|
|
||||||
if (cmd.argument().empty()) {
|
|
||||||
cur.errorMessage(_("LyX function 'layout' needs an argument."));
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Derive layout number from given argument (string)
|
// Derive layout number from given argument (string)
|
||||||
// and current buffer's textclass (number)
|
// and current buffer's textclass (number)
|
||||||
LyXTextClass const & tclass = bv->buffer()->params().getLyXTextClass();
|
LyXTextClass const & tclass = bv->buffer()->params().getLyXTextClass();
|
||||||
bool hasLayout = tclass.hasLayout(to_utf8(cmd.argument()));
|
if (layout.empty())
|
||||||
string layout = to_utf8(cmd.argument());
|
layout = tclass.defaultLayoutName();
|
||||||
|
bool hasLayout = tclass.hasLayout(layout);
|
||||||
|
|
||||||
// If the entry is obsolete, use the new one instead.
|
// If the entry is obsolete, use the new one instead.
|
||||||
if (hasLayout) {
|
if (hasLayout) {
|
||||||
|
Loading…
Reference in New Issue
Block a user