Skip to content

[v3] More update control over existing menus #4030

@FalcoG

Description

@FalcoG

Is your feature request related to a problem? Please describe.

Once a (tray) menu has been created, it can't have new menu items prepended to the menu.

In my use case I need to be able to prepend items and (partially) clear the tray menu after the application was launched.

e.g. a menu upon launch is as such:

  • Lights unavailable
  • Preferences
  • Quit App

menu later gets an update and becomes:

  • Light 1
  • Light 2
  • Light 3
  • Preferences
  • Quit App

This means 1 item gets removed, and 3 items are added.

Describe the solution you'd like

I want to be able to clear a menu, so I can simply construct the items again using multiple appends.

I'm working on a PR.

Describe alternatives you've considered

  1. Tried to add logic to every menu item to destroy them once I need an update. This however complicates the code a lot.
  2. Tried to override a tray menu, but this kept the old menu active.

Additional context

Image Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    EnhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions