InsetLayout, per Jurgen's suggestion, so that insets can be told to
display an abbreviated form of their content when closed.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@32575
a592a061-630c-0410-9148-
cb99ea01b6c8
#LyX 2.0.0svn created this file. For more info see http://www.lyx.org/
#LyX 2.0.0svn created this file. For more info see http://www.lyx.org/
\begin_document
\begin_header
\textclass scrbook
\begin_document
\begin_header
\textclass scrbook
\begin_inset Flex CharStyle:Code
status collapsed
\begin_inset Flex CharStyle:Code
status collapsed
+\begin_layout Plain Layout
+ContentAsLabel
+\end_layout
+
+\end_inset
+
+ [
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+
+\emph on
+0
+\end_layout
+
+\end_inset
+
+,
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+1
+\end_layout
+
+\end_inset
+
+] Whether to use the content of the inset as the label, when the inset is
+ closed.
+ Default is false.
+\end_layout
+
+\begin_layout Description
+\begin_inset Flex CharStyle:Code
+status collapsed
+
\begin_layout Plain Layout
CopyStyle
\end_layout
\begin_layout Plain Layout
CopyStyle
\end_layout
] Indicates whether the PlainLayout should be used or, instead, the user
can change the paragraph style used in the inset.
] Indicates whether the PlainLayout should be used or, instead, the user
can change the paragraph style used in the inset.
\end_layout
\begin_layout Description
\end_layout
\begin_layout Description
\end_layout
\begin_layout Description
\end_layout
\begin_layout Description
\end_layout
\begin_layout Description
\end_layout
\begin_layout Description
\end_inset
] Whether multiple paragraphs are permitted in this inset.
\end_inset
] Whether multiple paragraphs are permitted in this inset.
- This will also set CustomPars to the same value and ForcePlain to the opposite
- value.
+ This will also set
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+CustomPars
+\end_layout
+
+\end_inset
+
+ to the same value and
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+ForcePlain
+\end_layout
+
+\end_inset
+
+ to the opposite value.
These can be reset to other values, if they are used
\emph on
after
\emph default
These can be reset to other values, if they are used
\emph on
after
\emph default
+
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+MultiPar
+\end_layout
+
+\end_inset
+
+.
+ Default is true.
\end_layout
\begin_layout Description
\end_layout
\begin_layout Description
\emph on
not
\emph default
\emph on
not
\emph default
- whether the command should itself be protected.)
+ whether the command should itself be protected.) Default is false.
\end_layout
\begin_layout Description
\end_layout
\begin_layout Description
] As with paragraph styles (see page
\begin_inset CommandInset ref
] As with paragraph styles (see page
\begin_inset CommandInset ref
reference "des:PathThru"
\end_inset
).
reference "des:PathThru"
\end_inset
).
\end_layout
\begin_layout Description
\end_layout
\begin_layout Description
LyXType standard
Decoration classic
LabelString URL
LyXType standard
Decoration classic
LabelString URL
LatexName url
LatexType command
Requires url
LatexName url
LatexType command
Requires url
# Incremented to format 19, 17 November 2009 by rgh
# Added InPreamble tag.
# Incremented to format 19, 17 November 2009 by rgh
# Added InPreamble tag.
+# Incremented to format 20, 17 December 2009 by rgh
+# Added ContentAsLabel tag.
+
# Do not forget to document format change in Customization
# Manual (section "Declaring a new text class").
# Do not forget to document format change in Customization
# Manual (section "Declaring a new text class").
continue
# This just involved new features, not any changes to old ones
continue
# This just involved new features, not any changes to old ones
- if format == 14 or format == 15 or format == 16 or format == 17 or format == 18:
+ if format >= 14 and format <= 19:
};
// Keep the changes documented in the Customization manual.
};
// Keep the changes documented in the Customization manual.
bool layout2layout(FileName const & filename, FileName const & tempfile)
bool layout2layout(FileName const & filename, FileName const & tempfile)
-docstring const InsetCollapsable::buttonLabel(BufferView const &) const
+docstring const InsetCollapsable::buttonLabel(BufferView const & bv) const
- return labelstring_.empty() ?
+ docstring const label = labelstring_.empty() ?
translateIfPossible(getLayout().labelstring()) : labelstring_;
translateIfPossible(getLayout().labelstring()) : labelstring_;
+ InsetLayout const & il = getLayout();
+ if (!il.contentaslabel() || geometry(bv) != ButtonOnly)
+ return label;
+ return getNewLabel(label);
InsetLayout::InsetLayout() :
name_(from_ascii("undefined")), lyxtype_(STANDARD),
InsetLayout::InsetLayout() :
name_(from_ascii("undefined")), lyxtype_(STANDARD),
- labelstring_(from_ascii("UNDEFINED")), decoration_(DEFAULT),
- latextype_(NOLATEXTYPE), font_(sane_font),
+ labelstring_(from_ascii("UNDEFINED")), contentaslabel_(false),
+ decoration_(DEFAULT), latextype_(NOLATEXTYPE), font_(sane_font),
labelfont_(sane_font), bgcolor_(Color_error),
htmlforcecss_ (false), htmlisblock_(true),
multipar_(true), custompars_(true), forceplain_(false),
labelfont_(sane_font), bgcolor_(Color_error),
htmlforcecss_ (false), htmlisblock_(true),
multipar_(true), custompars_(true), forceplain_(false),
IL_COPYSTYLE,
IL_COUNTER,
IL_CUSTOMPARS,
IL_COPYSTYLE,
IL_COUNTER,
IL_CUSTOMPARS,
LexerKeyword elementTags[] = {
{ "bgcolor", IL_BGCOLOR },
LexerKeyword elementTags[] = {
{ "bgcolor", IL_BGCOLOR },
+ { "contentaslabel", IL_CONTENTASLABEL },
{ "copystyle", IL_COPYSTYLE },
{ "counter", IL_COUNTER},
{ "custompars", IL_CUSTOMPARS },
{ "copystyle", IL_COPYSTYLE },
{ "counter", IL_COUNTER},
{ "custompars", IL_CUSTOMPARS },
case IL_NEEDPROTECT:
lex >> needprotect_;
break;
case IL_NEEDPROTECT:
lex >> needprotect_;
break;
+ case IL_CONTENTASLABEL:
+ lex >> contentaslabel_;
+ break;
case IL_COPYSTYLE: { // initialize with a known style
docstring style;
lex >> style;
case IL_COPYSTYLE: { // initialize with a known style
docstring style;
lex >> style;
///
docstring labelstring() const { return labelstring_; }
///
///
docstring labelstring() const { return labelstring_; }
///
+ bool contentaslabel() const { return contentaslabel_; }
+ ///
InsetDecoration decoration() const { return decoration_; }
///
InsetLaTeXType latextype() const { return latextype_; }
InsetDecoration decoration() const { return decoration_; }
///
InsetLaTeXType latextype() const { return latextype_; }
///
docstring labelstring_;
///
///
docstring labelstring_;
///
+ bool contentaslabel_;
+ ///
InsetDecoration decoration_;
///
InsetLaTeXType latextype_;
InsetDecoration decoration_;
///
InsetLaTeXType latextype_;