On Thu, Oct 19, 2006 at 03:41:39PM +0200, Jean-Marc Lasgouttes wrote:
> >>>>> "Martin" == Martin Vermeer <[EMAIL PROTECTED]> writes:
> 
> Martin> Attached. Can this go in (trunk)? 
> 
> Why not. If it works, I want this in 1.4 too.
> 
> JMarc

Here is the 1.4 version. Works for me.

- Martin

Index: status.14x
===================================================================
--- status.14x  (revision 15386)
+++ status.14x  (working copy)
@@ -60,6 +60,8 @@ What's new
 
 - Don't show starred sections in Document->Numbering & TOC (bug 2910)
 
+- Make clicking in a "Wide" inset always enter that inset.
+
 * Build/installation:
 
 
Index: src/insets/insettext.C
===================================================================
--- src/insets/insettext.C      (revision 15216)
+++ src/insets/insettext.C      (working copy)
@@ -17,6 +17,7 @@
 #include "bufferparams.h"
 #include "BufferView.h"
 #include "CutAndPaste.h"
+#include "coordcache.h"
 #include "cursor.h"
 #include "debug.h"
 #include "dispatchresult.h"
@@ -224,6 +225,16 @@ void InsetText::drawSelection(PainterInf
 }
 
 
+bool InsetText::covers(int x, int y) const
+{
+        return theCoords.getInsets().has(this)
+                        && x >= xo()
+                        && x <= xo() + width() + (Wide() ? text_.maxwidth_ : 0)
+                        && y >= yo() - ascent()
+                        && y <= yo() + descent();
+}
+
+
 string const InsetText::editMessage() const
 {
        return _("Opened Text Inset");
Index: src/insets/insettext.h
===================================================================
--- src/insets/insettext.h      (revision 15216)
+++ src/insets/insettext.h      (working copy)
@@ -52,6 +52,8 @@ public:
        void draw(PainterInfo & pi, int x, int y) const;
        /// draw inset selection
        void drawSelection(PainterInfo & pi, int x, int y) const;
+       /// do we cover screen position x/y?
+       virtual bool covers(int x, int y) const;
        ///
        std::string const editMessage() const;
        ///

Attachment: pgplEVzqOs21Y.pgp
Description: PGP signature

Reply via email to