mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-09-20 15:01:58 +00:00
Fix bug 3301 (selecting buttons (e.g. a citation) with the mouse opens dialog)
* insets/InsetExternal.cpp (doDispatch): * insets/InsetGraphics.cpp (doDispatch): * insets/InsetInclude.cpp (doDispatch): * insets/InsetCommand.cpp (doDispatch): * insets/InsetVSpace.cpp (doDispatch): do not open dialog if a selection is set. * insets/InsetRef.cpp (doDispatch): * insets/InsetCharStyle.cpp (doDispatch): act on mouse release, not mouse press. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18473 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
68b3ad672d
commit
e499a5428e
@ -239,11 +239,11 @@ void InsetCharStyle::doDispatch(Cursor & cur, FuncRequest & cmd)
|
||||
setInlined();
|
||||
switch (cmd.action) {
|
||||
|
||||
case LFUN_MOUSE_PRESS:
|
||||
case LFUN_MOUSE_RELEASE:
|
||||
if (cmd.button() == mouse_button::button3)
|
||||
params_.show_label = !params_.show_label;
|
||||
else
|
||||
InsetText::doDispatch(cur, cmd);
|
||||
InsetCollapsable::doDispatch(cur, cmd);
|
||||
break;
|
||||
|
||||
case LFUN_INSET_TOGGLE:
|
||||
|
@ -133,7 +133,7 @@ void InsetCommand::doDispatch(Cursor & cur, FuncRequest & cmd)
|
||||
}
|
||||
|
||||
case LFUN_MOUSE_RELEASE: {
|
||||
if (!mailer_name_.empty())
|
||||
if (!mailer_name_.empty() && !cur.selection())
|
||||
InsetCommandMailer(mailer_name_, *this).showDialog(&cur.bv());
|
||||
break;
|
||||
}
|
||||
|
@ -450,6 +450,7 @@ void InsetExternal::doDispatch(Cursor & cur, FuncRequest & cmd)
|
||||
break;
|
||||
|
||||
case LFUN_MOUSE_RELEASE:
|
||||
if (!cur.selection())
|
||||
InsetExternalMailer(*this).showDialog(&cur.bv());
|
||||
break;
|
||||
|
||||
|
@ -201,6 +201,7 @@ void InsetGraphics::doDispatch(Cursor & cur, FuncRequest & cmd)
|
||||
break;
|
||||
|
||||
case LFUN_MOUSE_RELEASE:
|
||||
if (!cur.selection())
|
||||
InsetGraphicsMailer(*this).showDialog(&cur.bv());
|
||||
break;
|
||||
|
||||
|
@ -161,6 +161,7 @@ void InsetInclude::doDispatch(Cursor & cur, FuncRequest & cmd)
|
||||
break;
|
||||
|
||||
case LFUN_MOUSE_RELEASE:
|
||||
if (!cur.selection())
|
||||
InsetIncludeMailer(*this).showDialog(&cur.bv());
|
||||
break;
|
||||
|
||||
|
@ -45,21 +45,17 @@ InsetRef::InsetRef(InsetRef const & ir)
|
||||
void InsetRef::doDispatch(Cursor & cur, FuncRequest & cmd)
|
||||
{
|
||||
switch (cmd.action) {
|
||||
case LFUN_MOUSE_PRESS:
|
||||
case LFUN_MOUSE_RELEASE:
|
||||
// Eventually trigger dialog with button 3 not 1
|
||||
if (cmd.button() == mouse_button::button3)
|
||||
lyx::dispatch(FuncRequest(LFUN_LABEL_GOTO, getParam("reference")));
|
||||
else {
|
||||
InsetCommandMailer("ref", *this).showDialog(&cur.bv());
|
||||
cur.undispatched();
|
||||
}
|
||||
return;
|
||||
|
||||
case LFUN_MOUSE_RELEASE:
|
||||
return;
|
||||
lyx::dispatch(FuncRequest(LFUN_LABEL_GOTO,
|
||||
getParam("reference")));
|
||||
else
|
||||
InsetCommand::doDispatch(cur, cmd);
|
||||
break;
|
||||
|
||||
default:
|
||||
return InsetCommand::doDispatch(cur, cmd);
|
||||
InsetCommand::doDispatch(cur, cmd);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -73,6 +73,7 @@ void InsetVSpace::doDispatch(Cursor & cur, FuncRequest & cmd)
|
||||
}
|
||||
|
||||
case LFUN_MOUSE_RELEASE:
|
||||
if (!cur.selection())
|
||||
InsetVSpaceMailer(*this).showDialog(&cur.bv());
|
||||
break;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user