GtkLabel: Allow to override popover
When we set the GtkLabel as selectable, a popover is automatically generated and it's only possible to add extra entries to the menu, but not override it completely.
We have a use case in Fractal, were we have a list of messages that can be text, images, videos, etc. and we need to have a consistent context menu between the different types. It makes sense for us to prioritize quick actions over text selection actions, and it's not possible to reorder menu entries with the current API. And since the selectable
property and the popover are tightly integrated, we would lose all the selection logic if we try to provide our own popover.
As a side note, the current popover for GtkLabel seems like a bad UX: since it's immutable text, the Cut
, Paste
, and Delete
actions will always be grayed out and are generally unexpected in that context. It adds unnecessary visual noise.