X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Finsets%2FInsetBox.cpp;h=2f31dcc71986ab3b63433298d1f0077c016d14c2;hb=e2fc0d43851bad3aff6cb7d6d7f7960d7bb3bbc4;hp=09d7a49797d772b6b57785e9f5b1d98c7a27d25c;hpb=c4570a96daba95fe2d25a169674bb08228dc9a32;p=lyx.git diff --git a/src/insets/InsetBox.cpp b/src/insets/InsetBox.cpp index 09d7a49797..2f31dcc719 100644 --- a/src/insets/InsetBox.cpp +++ b/src/insets/InsetBox.cpp @@ -28,6 +28,7 @@ #include "support/debug.h" #include "support/gettext.h" +#include "support/lstrings.h" #include "support/Translator.h" #include "frontends/Application.h" @@ -35,6 +36,7 @@ #include using namespace std; +using namespace lyx::support; namespace lyx { @@ -139,21 +141,34 @@ void InsetBox::read(Lexer & lex) void InsetBox::setButtonLabel() { - BoxType btype = boxtranslator().find(params_.type); + BoxType const btype = boxtranslator().find(params_.type); - docstring label; - label += _("Box"); - label += " ("; - if (btype == Frameless) { + docstring const type = _("Box"); + + docstring inner; + if (params_.inner_box) { if (params_.use_parbox) - label += _("Parbox"); + inner = _("Parbox"); else - label += _("Minipage"); - } else { - label += boxtranslator_loc().find(btype); + inner = _("Minipage"); } - label += ")"; + docstring frame; + if (btype != Frameless) + frame = boxtranslator_loc().find(btype); + + docstring label; + if (inner.empty() && frame.empty()) + label = type; + else if (inner.empty()) + label = bformat(_("%1$s (%2$s)"), + type, frame); + else if (frame.empty()) + label = bformat(_("%1$s (%2$s)"), + type, inner); + else + label = bformat(_("%1$s (%2$s, %3$s)"), + type, inner, frame); setLabel(label); }