diff --git a/src/insets/InsetTOC.cpp b/src/insets/InsetTOC.cpp index db94ccc2f6..e297ef4be6 100644 --- a/src/insets/InsetTOC.cpp +++ b/src/insets/InsetTOC.cpp @@ -14,8 +14,10 @@ #include "Buffer.h" #include "BufferParams.h" +#include "Cursor.h" #include "DispatchResult.h" #include "Font.h" +#include "FuncRequest.h" #include "Language.h" #include "LaTeXFeatures.h" #include "OutputParams.h" @@ -58,6 +60,21 @@ docstring InsetTOC::screenLabel() const } +void InsetTOC::doDispatch(Cursor & cur, FuncRequest & cmd) { + switch (cmd.action()) { + case LFUN_MOUSE_RELEASE: + if (!cur.selection() && cmd.button() == mouse_button::button1) { + showInsetDialog(&cur.bv()); + cur.dispatched(); + } + break; + + default: + InsetCommand::doDispatch(cur, cmd); + } +} + + int InsetTOC::plaintext(odocstream & os, OutputParams const &) const { os << screenLabel() << "\n\n"; diff --git a/src/insets/InsetTOC.h b/src/insets/InsetTOC.h index 5dba25ca8d..cb32c66ac3 100644 --- a/src/insets/InsetTOC.h +++ b/src/insets/InsetTOC.h @@ -39,6 +39,8 @@ public: int docbook(odocstream &, OutputParams const &) const; /// docstring xhtml(XHTMLStream & xs, OutputParams const &) const; + /// + void doDispatch(Cursor & cur, FuncRequest & cmd); //@} /// \name Static public methods obligated for InsetCommand derived classes