Author: paullanders
Date: Fri Jan  9 00:50:28 2015
New Revision: 38284

URL: http://svn.gna.org/viewcvs/gnustep?rev=38284&view=rev
Log:
allow a supermenu menu item to be disabled if it's submenu is empty.


Modified:
    plugins/themes/WinUXTheme/ChangeLog
    plugins/themes/WinUXTheme/WinNSMenu.m

Modified: plugins/themes/WinUXTheme/ChangeLog
URL: 
http://svn.gna.org/viewcvs/gnustep/plugins/themes/WinUXTheme/ChangeLog?rev=38284&r1=38283&r2=38284&view=diff
==============================================================================
--- plugins/themes/WinUXTheme/ChangeLog (original)
+++ plugins/themes/WinUXTheme/ChangeLog Fri Jan  9 00:50:28 2015
@@ -1,3 +1,7 @@
+2015-1-8 Paul Landers <[email protected]>
+
+    * WinNSMenu.m: Allow a menu item with a submenu to be disabled, if it 
contains no items.
+
 2014-12-17 Paul Landers <[email protected]>
 
     * WinNSOpenPanel.m: Setting the list of allowedFileTypes uses only those 
in the list. 

Modified: plugins/themes/WinUXTheme/WinNSMenu.m
URL: 
http://svn.gna.org/viewcvs/gnustep/plugins/themes/WinUXTheme/WinNSMenu.m?rev=38284&r1=38283&r2=38284&view=diff
==============================================================================
--- plugins/themes/WinUXTheme/WinNSMenu.m       (original)
+++ plugins/themes/WinUXTheme/WinNSMenu.m       Fri Jan  9 00:50:28 2015
@@ -296,10 +296,10 @@
                    [[[NSString alloc] initWithCharacters: &ellipsis length: 1] 
autorelease]
                                               withString: @"..."];
 
-      // If it's enabled and not a seperator or a supermenu,
+      // If it's enabled and not a seperator or a supermenu (unless submenu is 
empty),
       // determine if it's enabled and set it's state accordingly.
       if([item isSeparatorItem] == NO &&
-        [item hasSubmenu] == NO)
+        ([item hasSubmenu] == NO || [[item submenu] numberOfItems] == 0) )
        {
          flags |= ([item isEnabled]?MF_ENABLED:MF_GRAYED); // shouldn't this 
be :MF_GRAYED|MF_DISABLED ?
           if ([item state] == NSOnState)


_______________________________________________
Gnustep-cvs mailing list
[email protected]
https://mail.gna.org/listinfo/gnustep-cvs

Reply via email to