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

  • From: superstippi@xxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Sat, 23 Jan 2010 08:50:46 +0100 (CET)

Author: stippi
Date: 2010-01-23 08:50:45 +0100 (Sat, 23 Jan 2010)
New Revision: 35248
Changeset: http://dev.haiku-os.org/changeset/35248/haiku
Ticket: http://dev.haiku-os.org/ticket/4147

Modified:
   haiku/trunk/src/kits/interface/Menu.cpp
Log:
Patch by "stimut": Fixed BMenu to return only enabled BMenuItems when invoking
them via mouse. This will make the mechanism that BSeparatorItems are always
disabled actually work and the behavior correct for other items as well. It also
fixes #4147 (Magnify crashing because it assume all its items have a BMessage).

Thanks a lot!


Modified: haiku/trunk/src/kits/interface/Menu.cpp
===================================================================
--- haiku/trunk/src/kits/interface/Menu.cpp     2010-01-22 21:51:26 UTC (rev 
35247)
+++ haiku/trunk/src/kits/interface/Menu.cpp     2010-01-23 07:50:45 UTC (rev 
35248)
@@ -2437,7 +2437,7 @@
        int32 itemCount = CountItems();
        for (int32 i = 0; i < itemCount; i++) {
                BMenuItem* item = ItemAt(i);
-               if (item->Frame().Contains(where))
+               if (item->IsEnabled() && item->Frame().Contains(where))
                        return item;
        }
 


Other related posts:

  • » [haiku-commits] r35248 - haiku/trunk/src/kits/interface - superstippi