Upgrade TouchCORE menus - creation of a new menu

Issue #315 resolved
Cécile Camillieri created an issue

Right now the menus in TouchCORE are defined in each scene which leads to a lot of code duplication, makes adding buttons complicated and sometimes leads to inconsistencies (see #302). Also the menu is at the fixed position which is not handy when working on a big screen. The idea of this task is to create a new menu for TouchCORE which can be customized easily by scenes and can be moved around to different places in the screen.

This task will consist in the creation and basic integration of a new menu in TouchCORE. A later issue will probably consist in creating a "super scene" class that contains by default the new menu and allows subclasses to customize it and handle its events more easily.

The menu we decided on is constructed around a central circle (see screenshot).

The main features of the menu are the following:

  • Allow the developer to define sub-menus containing different buttons.
  • Buttons consist of text and an optional icon.
  • The menu can display buttons in sub-menus or directly around the circle.
  • Sub menus can be opened by clicking them and stay open until clicked again.
  • The menu should be able to layout itself depending on its location on the screen (see screenshots):
    • In a corner, only 3 icons or sub-menus will be available (or 2 if the buttons are text-based).
    • On edges, at most 5 icons or sub-menus will be displayed.
    • In the middle of the screen, up to 8 can be used.
  • We can define sub menus or group of items that always need to be displayed (for example like the buttons "undo/redo" and "save")
  • If there is enough space, buttons will not be displayed in sub-menus (we may want to prevent that for some menus).
    • To do this properly, we can define a priority among our sub-menus. A sub menu containing highly used action will probably have a higher priority. This means that if there are spaces left in the menu we can put its buttons directly available instead of in a sub menu.
    • Buttons of the same sub-menu will always be displayed next to each other.
  • If there is no icon defined for a button, text will be displayed by default.
    • Text should only be displayed in vertical lists so it's easy to read. This could lead the "merge" of different sub-menus when the menu is in a corner for example.
    • If a sub-menu item has no icon, all items from the same menu should be displayed in text. They all should have the same width.
    • For clarity reasons, if there are any text buttons, the locations next to them around the circle should not be used.
  • Items from different sub-menus could be represented by different background colors defined by the user.

Additions from latest meeting:

  • Always display icons/short name and allow to switch to text with a tap and hold gesture on the central circle.
  • Text may be displayed somewhere (middle circle?) when hovering the buttons in "icon mode".
  • sub menus have an icon or short name + arrow to show they can be opened.
  • when grouping sub menus, have a specific icon on the sub menu (eg, only an arrow)

Comments (38)

  1. Former user Account Deleted

    References #315: Menu added to the first scene + child position arround the menu + menu can be dragged near a side or a corner and it's stuck on the edge.

    → <<cset 860ae9f7d217>>

  2. Matthias Schoettle

    I don't know if it would still be necessary with context-sensitive menus. But different views within the same scene might need a different menu or need/don't need certain buttons.

  3. Former user Account Deleted

    Yes, we'll have an abstract scene containing the menu reference, and then when the scene modify its view, the developer can update the menu with new actions or remove some actions.

  4. Former user Account Deleted

    References #315: items are well placed arround the menu, the algorithm is different and all actions of a sub menu are added if there is enough space to place them all.

    → <<cset 3e0349fc1931>>

  5. Former user Account Deleted

    References #315: Add icon on sub-menu, add handler in RamAbstractScene, created BasicActionsUtils with save/undo/redo methods, add menu in each scene

    → <<cset 69569965d0d8>>

  6. Former user Account Deleted

    References #315: refactor the main layer into RamAbstractScene (topLayer > containerLayer + menu). ContainerLayer is the main layer for childs. Menu integration into all scenes (handlers not working properly). Add icons to all actions.

    → <<cset 85d06fe82ba2>>

  7. Former user Account Deleted

    References #315: handle action on undo/redo/save with merge in RamAbstractScene. Delete unique operation save in BasicActionsUtils because of listeners needed in saveAspect.

    → <<cset 716f15e15cdf>>

  8. Former user Account Deleted

    References #315: replace back button in split view to close button + add icon reaction on collapse/Expand sub-menus + weave button icon modified + clean code.

    → <<cset 638f6fd594df>>

  9. Former user Account Deleted

    References #315: Javadoc, add enableAction and toggleAction in RamMenu to support the temporary sub-menu,modification weave icon in impact view to a validation icon.

    → <<cset 96583fa9ac50>>

  10. Former user Account Deleted

    References #315-Menu-Integration: move addSelector to RamAbstractScene + fix bug when you add button to the menu it was displayed in default mode + replace icon for clean (reuse) and switch to full/next mode + selectors can't be partially visible + generate selector is shown on the menu + fix checkstyle errors.

    → <<cset 489903fa71e2>>

  11. Log in to comment