]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetCollapsable.cpp
Fix wrongly copy-pasted entries in SpellcheckerUi.ui
[lyx.git] / src / insets / InsetCollapsable.cpp
index 4fb0b2cc8ca20165c0be29389583d123491e5ef9..a8a114f3a6481bab3fed4477fbd643c2c697682d 100644 (file)
@@ -583,9 +583,9 @@ void InsetCollapsable::setLabel(docstring const & l)
 
 docstring const InsetCollapsable::buttonLabel(BufferView const & bv) const
 {
-       docstring const label = labelstring_.empty() ? 
-               translateIfPossible(getLayout().labelstring()) : labelstring_;
        InsetLayout const & il = getLayout();
+       docstring const label = labelstring_.empty() ? 
+               translateIfPossible(il.labelstring()) : labelstring_;
        if (!il.contentaslabel() || geometry(bv) != ButtonOnly)
                return label;
        return getNewLabel(label);
@@ -621,17 +621,32 @@ InsetLayout::InsetDecoration InsetCollapsable::decoration() const
 docstring InsetCollapsable::contextMenu(BufferView const & bv, int x,
        int y) const
 {
+       docstring context_menu = contextMenuName();
+       docstring const it_context_menu = InsetText::contextMenuName();
        if (decoration() == InsetLayout::CONGLOMERATE)
-               return from_ascii("context-conglomerate");
+               return context_menu + ";" + it_context_menu;
+
+       docstring const ic_context_menu = InsetCollapsable::contextMenuName();
+       if (ic_context_menu != context_menu)
+               context_menu += ";" + ic_context_menu;
 
        if (geometry(bv) == NoButton)
-               return from_ascii("context-collapsable");
+               return context_menu + ";" + it_context_menu;
 
        Dimension dim = dimensionCollapsed(bv);
        if (x < xo(bv) + dim.wid && y < yo(bv) + dim.des)
-               return from_ascii("context-collapsable");
+               return context_menu;
 
-       return InsetText::contextMenu(bv, x, y);
+       return it_context_menu;
+}
+
+
+docstring InsetCollapsable::contextMenuName() const
+{
+       if (decoration() == InsetLayout::CONGLOMERATE)
+               return from_ascii("context-conglomerate");
+       else
+               return from_ascii("context-collapsable");
 }
 
 } // namespace lyx