diff --git a/src/insets/InsetCollapsable.cpp b/src/insets/InsetCollapsable.cpp index 28c941c55a..930c171df7 100644 --- a/src/insets/InsetCollapsable.cpp +++ b/src/insets/InsetCollapsable.cpp @@ -875,17 +875,7 @@ docstring InsetCollapsable::floatName(string const & type) const InsetLayout::InsetDecoration InsetCollapsable::decoration() const { InsetLayout::InsetDecoration const dec = getLayout().decoration(); - switch (dec) { - case InsetLayout::CLASSIC: - case InsetLayout::MINIMALISTIC: - case InsetLayout::CONGLOMERATE: - return dec; - case InsetLayout::DEFAULT: - break; - } - if (lyxCode() == FLEX_CODE) - return InsetLayout::CONGLOMERATE; - return InsetLayout::CLASSIC; + return dec == InsetLayout::DEFAULT ? InsetLayout::CLASSIC : dec; } diff --git a/src/insets/InsetFlex.cpp b/src/insets/InsetFlex.cpp index aaf71aa90d..80c755bc28 100644 --- a/src/insets/InsetFlex.cpp +++ b/src/insets/InsetFlex.cpp @@ -41,6 +41,13 @@ InsetFlex::InsetFlex(InsetFlex const & in) {} +InsetLayout::InsetDecoration InsetFlex::decoration() const +{ + InsetLayout::InsetDecoration const dec = getLayout().decoration(); + return dec == InsetLayout::DEFAULT ? InsetLayout::CONGLOMERATE : dec; +} + + docstring InsetFlex::editMessage() const { return _("Opened Flex Inset"); diff --git a/src/insets/InsetFlex.h b/src/insets/InsetFlex.h index 239ced831f..9e2ed16f74 100644 --- a/src/insets/InsetFlex.h +++ b/src/insets/InsetFlex.h @@ -30,6 +30,8 @@ public: docstring editMessage() const; /// InsetCode lyxCode() const { return FLEX_CODE; } + /// Default looks + InsetLayout::InsetDecoration decoration() const; /// void write(std::ostream &) const; /// should paragraph indendation be ommitted in any case?