Move the enum into InsetLayout.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23136 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Richard Heck 2008-02-22 16:24:55 +00:00
parent 2c357c1d23
commit 2812202c2b
7 changed files with 30 additions and 31 deletions

View File

@ -92,7 +92,7 @@ void InsetBranch::setButtonLabel()
s = _("Undef: ") + s;
}
}
if (decoration() == Deco_Classic)
if (decoration() == InsetLayout::Classic)
setLabel(isOpen() ? s : getNewLabel(s) );
else
setLabel(params_.branch + ": " + getNewLabel(s));

View File

@ -52,7 +52,7 @@ InsetCollapsable::CollapseStatus InsetCollapsable::status() const
InsetCollapsable::Geometry InsetCollapsable::geometry() const
{
switch (decoration()) {
case Deco_Classic:
case InsetLayout::Classic:
if (status() == Open) {
if (openinlined_)
return LeftButton;
@ -61,13 +61,13 @@ InsetCollapsable::Geometry InsetCollapsable::geometry() const
} else
return ButtonOnly;
case Deco_Minimalistic:
case InsetLayout::Minimalistic:
return status() == Open ? NoButton : ButtonOnly ;
case Deco_Conglomerate:
case InsetLayout::Conglomerate:
return status() == Open ? SubLabel : Corners ;
case Deco_Default:
case InsetLayout::Default:
break; // this shouldn't happen
}
@ -536,7 +536,7 @@ void InsetCollapsable::doDispatch(Cursor & cur, FuncRequest & cmd)
case LFUN_MOUSE_RELEASE:
if (cmd.button() == mouse_button::button3) {
// There is no button to right click:
if (decoration() == Deco_Minimalistic ||
if (decoration() == InsetLayout::Minimalistic ||
geometry() == Corners ||
geometry() == SubLabel ||
geometry() == NoButton
@ -801,23 +801,23 @@ docstring InsetCollapsable::floatName(string const & type, BufferParams const &
}
InsetDecoration InsetCollapsable::decoration() const
InsetLayout::InsetDecoration InsetCollapsable::decoration() const
{
if (!layout_)
return Deco_Classic;
InsetDecoration const dec = layout_->decoration();
return InsetLayout::Classic;
InsetLayout::InsetDecoration const dec = layout_->decoration();
switch (dec) {
case Deco_Classic:
case Deco_Minimalistic:
case Deco_Conglomerate:
case InsetLayout::Classic:
case InsetLayout::Minimalistic:
case InsetLayout::Conglomerate:
return dec;
case Deco_Default:
case InsetLayout::Default:
break;
}
if (lyxCode() == FLEX_CODE)
// FIXME: Is this really necessary?
return Deco_Conglomerate;
return Deco_Classic;
return InsetLayout::Conglomerate;
return InsetLayout::Classic;
}

View File

@ -118,7 +118,7 @@ public:
*/
/// Default looks
virtual InsetDecoration decoration() const;
virtual InsetLayout::InsetDecoration decoration() const;
///
enum Geometry {
TopButton,

View File

@ -189,7 +189,7 @@ bool InsetERT::getStatus(Cursor & cur, FuncRequest const & cmd,
void InsetERT::setButtonLabel()
{
if (decoration() == Deco_Classic)
if (decoration() == InsetLayout::Classic)
setLabel(isOpen() ? _("ERT") : getNewLabel(_("ERT")));
else
setLabel(getNewLabel(_("ERT")));

View File

@ -60,15 +60,15 @@ enum InsetLayoutTags {
namespace {
InsetDecoration translateDecoration(std::string const & str)
InsetLayout::InsetDecoration translateDecoration(std::string const & str)
{
if (str == "classic")
return Deco_Classic;
return InsetLayout::Classic;
if (str == "minimalistic")
return Deco_Minimalistic;
return InsetLayout::Minimalistic;
if (str == "conglomerate")
return Deco_Conglomerate;
return Deco_Default;
return InsetLayout::Conglomerate;
return InsetLayout::Default;
}
}

View File

@ -25,20 +25,19 @@ namespace lyx {
class Lexer;
///
enum InsetDecoration {
Deco_Classic,
Deco_Minimalistic,
Deco_Conglomerate,
Deco_Default
};
///
class InsetLayout {
public:
///
InsetLayout();
///
enum InsetDecoration {
Classic,
Minimalistic,
Conglomerate,
Default
};
///
bool read(Lexer & lexrc);
///
docstring name() const { return name_; };

View File

@ -251,7 +251,7 @@ bool InsetListings::getStatus(Cursor & cur, FuncRequest const & cmd,
void InsetListings::setButtonLabel()
{
// FIXME UNICODE
if (decoration() == Deco_Classic)
if (decoration() == InsetLayout::Classic)
setLabel(isOpen() ? _("Listing") : getNewLabel(_("Listing")));
else
setLabel(getNewLabel(_("Listing")));