Add support for titles in menus.
Added an addTitle() convenience method. Unfortunately, styling the background of the title either impossible or so deep down the rabbit hole... deeper than this??? git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@806 ed5b42cb-e716-0410-a449-f6a68f950b19
This commit is contained in:
@@ -24,6 +24,8 @@ package com.threerings.flex.menuClasses {
|
||||
|
||||
import flash.display.DisplayObject;
|
||||
|
||||
import mx.controls.Menu;
|
||||
import mx.controls.menuClasses.IMenuDataDescriptor;
|
||||
import mx.controls.menuClasses.MenuItemRenderer;
|
||||
|
||||
public class CommandMenuItemRenderer extends MenuItemRenderer
|
||||
@@ -43,6 +45,17 @@ public class CommandMenuItemRenderer extends MenuItemRenderer
|
||||
addChild(DisplayObject(icon));
|
||||
}
|
||||
}
|
||||
|
||||
if (label.visible) {
|
||||
var dataDescriptor :IMenuDataDescriptor = Menu(listData.owner).dataDescriptor;
|
||||
var typeVal :String = dataDescriptor.getType(data);
|
||||
if (typeVal == "title") {
|
||||
dataDescriptor.setEnabled(data, false);
|
||||
label.enabled = false;
|
||||
label.styleName = "menuTitle";
|
||||
invalidateDisplayList();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user