Closed DJ-Raven closed 7 months ago
raven.drawer.component.menu.data.MenuItem
MenuItem items[] = new MenuItem[]{ new Item.Label("MAIN"), new Item("Dashboard", "dashboard.svg"), new Item.Label("WEB APP"), new Item("Email", "email.svg") .subMenu("Inbox") .subMenu( new Item("Group Read") .subMenu("Read 1") .subMenu("Read 2") .subMenu("Read 3") .subMenu("Read 4") .subMenu("Read 5") ) .subMenu("Compost"), new Item("Chat", "chat.svg"), };
// old code changed public void styleMenuItem(JButton menu, int index)
// new code public void styleMenuItem(JButton menu, int[] index)
// removed public void styleSubMenuItem(JButton subMenu, int index, int subIndex)
- Menu event ``` java // old code simpleMenuOption.addMenuEvent(new MenuEvent() { @Override public void selected(MenuAction action, int index, int subIndex) { if (index == 0) { FormManager.showForm(new DashboardForm()); } } }); // new code simpleMenuOption.addMenuEvent(new MenuEvent() { @Override public void selected(MenuAction action, int[] index) { if (index.length == 1) { if (index[0] == 0) { FormManager.showForm(new DashboardForm()); } } else if (index.length == 2) { if (index[0] == 1) { if (index[1] == 0) { FormManager.showForm(new InboxForm()); } else if (index[1] == 1) { FormManager.showForm(new ReadForm()); } } } } });
simpleMenuOption.setIcons(icons)
Updated
Code changed
raven.drawer.component.menu.data.MenuItem
// new code public void styleMenuItem(JButton menu, int[] index)
// removed public void styleSubMenuItem(JButton subMenu, int index, int subIndex)
simpleMenuOption.setIcons(icons)