]> git.lyx.org Git - features.git/commitdiff
Fix bug 3301 (selecting buttons (e.g. a citation) with the mouse opens dialog)
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Wed, 23 May 2007 10:35:57 +0000 (10:35 +0000)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Wed, 23 May 2007 10:35:57 +0000 (10:35 +0000)
* 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

src/insets/InsetCharStyle.cpp
src/insets/InsetCommand.cpp
src/insets/InsetExternal.cpp
src/insets/InsetGraphics.cpp
src/insets/InsetInclude.cpp
src/insets/InsetRef.cpp
src/insets/InsetVSpace.cpp

index 84ee71fd0f03d2d7e3db0332c1a370b02fa71462..9bb7ae27741aacc768d2c718d1215753ab7385cc 100644 (file)
@@ -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:
index 3c1fce2a8c86d841ca34f231db4c237a986a010b..74cb84585577c28cdfd191441b156a35e4330384 100644 (file)
@@ -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;
        }
index 0a9f0ec6420605aef52f652656d05e3e78ae35b8..56d9401ce55ddca1f37dfb650458ca4f930ad204 100644 (file)
@@ -450,7 +450,8 @@ void InsetExternal::doDispatch(Cursor & cur, FuncRequest & cmd)
                break;
 
        case LFUN_MOUSE_RELEASE:
-               InsetExternalMailer(*this).showDialog(&cur.bv());
+               if (!cur.selection())
+                       InsetExternalMailer(*this).showDialog(&cur.bv());
                break;
 
        default:
index ad144d2428af5c8d24704402bf51ddfafebb5f67..23dda7899f7412f2b29b301108857d39868afaea 100644 (file)
@@ -201,7 +201,8 @@ void InsetGraphics::doDispatch(Cursor & cur, FuncRequest & cmd)
                break;
 
        case LFUN_MOUSE_RELEASE:
-               InsetGraphicsMailer(*this).showDialog(&cur.bv());
+               if (!cur.selection())
+                       InsetGraphicsMailer(*this).showDialog(&cur.bv());
                break;
 
        default:
index 968fa82e489becad97c56970122a0d51e168f3a7..1b7ddf81a3dcd42d2a168855f3495a29071bf618 100644 (file)
@@ -161,7 +161,8 @@ void InsetInclude::doDispatch(Cursor & cur, FuncRequest & cmd)
                break;
 
        case LFUN_MOUSE_RELEASE:
-               InsetIncludeMailer(*this).showDialog(&cur.bv());
+               if (!cur.selection()) 
+                       InsetIncludeMailer(*this).showDialog(&cur.bv());
                break;
 
        default:
index 515842e04e4a608dcea90b517d873be3671000a2..075344047a87175ced757d52d0348951dd6c92f9 100644 (file)
@@ -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);
        }
 }
 
index 3a8b0fcdaff2d208b19d3d357a7ba6272f24e013..70b9d6abb22add448066984bb6f22041f264c338 100644 (file)
@@ -73,7 +73,8 @@ void InsetVSpace::doDispatch(Cursor & cur, FuncRequest & cmd)
        }
 
        case LFUN_MOUSE_RELEASE:
-               InsetVSpaceMailer(*this).showDialog(&cur.bv());
+               if (!cur.selection())
+                       InsetVSpaceMailer(*this).showDialog(&cur.bv());
                break;
 
        default: