case LFUN_FONT_STATE:
case LFUN_FONT_UNDERLINE:
case LFUN_FOOTNOTE_INSERT:
- case LFUN_HFILL_INSERT:
case LFUN_HYPERLINK_INSERT:
case LFUN_INDEX_INSERT:
case LFUN_INDEX_PRINT:
return InsetText::getStatus(cur, cmd, flag);
case LFUN_INSET_TOGGLE:
- if (cmd.argument() == "open" || cmd.argument() == "close" ||
- cmd.argument() == "toggle")
+ if ((cmd.argument() == "open" && status_ == Open)
+ || (cmd.argument() == "close" && status_ != Open)
+ || cmd.argument() == "toggle")
flag.enabled(true);
else
flag.enabled(false);
break;
}
if (lyxCode() == FLEX_CODE)
- // FIXME: Is this really necessary?
return InsetLayout::Conglomerate;
return InsetLayout::Classic;
}
-bool InsetCollapsable::isMacroScope() const
-{
- // layout_ == 0 leads to no latex output, so ignore
- // the macros outside
- if (!layout_)
- return true;
-
- // see InsetCollapsable::latex(...) below. In these case
- // an environment is opened there
- if (!layout_->latexname().empty())
- return true;
-
- return false;
-}
-
-
int InsetCollapsable::latex(odocstream & os,
OutputParams const & runparams) const
{
docstring InsetCollapsable::contextMenu(BufferView const & bv, int x,
int y) const
{
- if (geometry() != NoButton) {
- Dimension dim = dimensionCollapsed();
- if (x < xo(bv) + dim.wid && y < yo(bv) + dim.des)
- return docstring();
- }
+ if (geometry() == NoButton)
+ return from_ascii("context-collapsable");
+
+ Dimension dim = dimensionCollapsed();
+ if (x < xo(bv) + dim.wid && y < yo(bv) + dim.des)
+ //FIXME: We should offer the "context-collapsable" menu here too but
+ // this is not possible right now because the cursor must be set first.
+ return docstring();
return InsetText::contextMenu(bv, x, y);
}