[haiku-commits] r36885 - haiku/trunk/src/kits/interface

  • From: axeld@xxxxxxxxxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Fri, 21 May 2010 14:32:58 +0200 (CEST)

Author: axeld
Date: 2010-05-21 14:32:58 +0200 (Fri, 21 May 2010)
New Revision: 36885
Changeset: http://dev.haiku-os.org/changeset/36885/haiku

Modified:
   haiku/trunk/src/kits/interface/ToolTipManager.cpp
Log:
* Also hide tool tips if a key has been pressed.


Modified: haiku/trunk/src/kits/interface/ToolTipManager.cpp
===================================================================
--- haiku/trunk/src/kits/interface/ToolTipManager.cpp   2010-05-21 11:39:19 UTC 
(rev 36884)
+++ haiku/trunk/src/kits/interface/ToolTipManager.cpp   2010-05-21 12:32:58 UTC 
(rev 36885)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2009, Axel Dörfler, axeld@xxxxxxxxxxxxxxxxx
+ * Copyright 2009-2010, Axel Dörfler, axeld@xxxxxxxxxxxxxxxxx
  * Copyright 2009, Stephan Aßmus <superstippi@xxxxxx>.
  * All rights reserved. Distributed under the terms of the MIT License.
  */
@@ -42,6 +42,7 @@
        virtual void                            FrameResized(float width, float 
height);
        virtual void                            MouseMoved(BPoint where, uint32 
transit,
                                                                        const 
BMessage* dragMessage);
+       virtual void                            KeyDown(const char* bytes, 
int32 numBytes);
 
                        void                            HideTip();
                        void                            ShowTip();
@@ -82,7 +83,7 @@
 void
 ToolTipView::AttachedToWindow()
 {
-       SetEventMask(B_POINTER_EVENTS, 0);
+       SetEventMask(B_POINTER_EVENTS | B_KEYBOARD_EVENTS, 0);
        fToolTip->AttachedToWindow();
 }
 
@@ -128,6 +129,14 @@
 
 
 void
+ToolTipView::KeyDown(const char* bytes, int32 numBytes)
+{
+       if (!fToolTip->IsSticky())
+               HideTip();
+}
+
+
+void
 ToolTipView::HideTip()
 {
        if (fHidden)


Other related posts:

  • » [haiku-commits] r36885 - haiku/trunk/src/kits/interface - axeld