Change check- and radio-menuitems behavior
(Split from #3383 (moved).)
In Gtk3, popovers created via gtk_menu_button_set_menu_model()
close when a “simple-entry” is clicked, but stay opened when it’s a “check-entry” or a “radio-entry”.
This behavior looks good (examples taken from various games I maintain):
- a “Sound” check-entry will not give directly feedback, so having the popover staying opened allows to see whether you correctly enabled/disabled the sound, and didn’t clicked out of the popover for example;
- you can replace a Preferences dialog easily by a menu/submenu, because multiple booleans options could be toggled at the same time;
- in an “Appearance” menu, multiple radio-entries allows to test every game theme, for finding the one you need, before closing the popover once you choosed;
- a simple-entry will usually do something visible anyway, like open a dialog (think of “Help” or “About”), so closing is okay
Capture_d_écran_vidéo_de_23-11-2020_14_34_53
This behavior is not the one currently in Gtk4, because the created popover is now a “standard menu,” that (IIUC) comes from the time when we used menubars: for now, every menuitem clicked closes the menu. It would be quite better for every “standard menu” to use the Gtk3 behavior of the popover from the GtkMenuButton
, because that’s working great with current UI paradigms.
Edited by Arnaud B.