* now hasSettings only means... that the inset has a settings dialog
* and clickable means that something should happen with left-clicking on the inset
Some inset behaviours are changed:
* (V)Space insets are not clickable anymore (the settings dialog is still accessible via context menu and Edit menu)
* TOC inset is now shown as active
* FloatList inset is shown as active and clicking on it opens the relevant part of the TOC dialog
This could be a candidate for branch (2.0.4)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@40755
a592a061-630c-0410-9148-
cb99ea01b6c8
// if the derived inset did not explicitly handle mouse_release,
// we assume we request the settings dialog
if (!cur.selection() && cmd.button() == mouse_button::button1
- && hasSettings()) {
+ && clickable(cmd.x(), cmd.y()) && hasSettings()) {
FuncRequest tmpcmd(LFUN_INSET_SETTINGS);
dispatch(cur, tmpcmd);
}
void InsetCommand::metrics(MetricsInfo & mi, Dimension & dim) const
{
- button_.update(screenLabel(), editable() || hasSettings());
+ button_.update(screenLabel(), editable() || clickable(0, 0));
button_.metrics(mi, dim);
}
#include "Buffer.h"
#include "BufferParams.h"
+#include "BufferView.h"
+#include "Cursor.h"
#include "DispatchResult.h"
#include "Floating.h"
#include "FloatList.h"
#include "Font.h"
+#include "FuncRequest.h"
#include "Language.h"
#include "LaTeXFeatures.h"
#include "Lexer.h"
}
+void InsetFloatList::doDispatch(Cursor & cur, FuncRequest & cmd) {
+ switch (cmd.action()) {
+ case LFUN_MOUSE_RELEASE:
+ if (!cur.selection() && cmd.button() == mouse_button::button1) {
+ cur.bv().showDialog("toc", params2string(params()));
+ cur.dispatched();
+ }
+ break;
+
+ default:
+ InsetCommand::doDispatch(cur, cmd);
+ }
+}
+
+
void InsetFloatList::write(ostream & os) const
{
os << "FloatList " << to_ascii(getParam("type")) << "\n";
///
docstring xhtml(XHTMLStream &, OutputParams const &) const;
///
+ void doDispatch(Cursor & cur, FuncRequest & cmd);
+ ///
+ bool clickable(int, int) const { return true; }
+ ///
void validate(LaTeXFeatures & features) const;
//@}
bool isSpace() const { return true; }
///
std::string contextMenuName() const;
- ///
- bool clickable(int /* x */, int /* y */) const { return true; }
protected:
///
Inset * clone() const { return new InsetSpace(*this); }
#include "Buffer.h"
#include "BufferParams.h"
+#include "BufferView.h"
#include "Cursor.h"
#include "DispatchResult.h"
#include "Font.h"
switch (cmd.action()) {
case LFUN_MOUSE_RELEASE:
if (!cur.selection() && cmd.button() == mouse_button::button1) {
- showInsetDialog(&cur.bv());
+ cur.bv().showDialog("toc", params2string(params()));
cur.dispatched();
}
break;
docstring xhtml(XHTMLStream & xs, OutputParams const &) const;
///
void doDispatch(Cursor & cur, FuncRequest & cmd);
+ ///
+ bool clickable(int, int) const { return true; }
//@}
/// \name Static public methods obligated for InsetCommand derived classes
static void string2params(std::string const &, VSpace &);
///
static std::string params2string(VSpace const &);
- ///
- bool clickable(int, int) const { return true; }
private:
///
void metrics(MetricsInfo & mi, Dimension & dim) const;