Add radio-button-looking entries to PopupMenu
They work exactly the same as current checkbox-decorated items, but in order to preserve compatibility, separate methods are used, like `add_radio_check_item()`. The other option would have been to add a new parameter at the end of `add_check_item()` and the like, but that would have forced callers to provide the defaults manually. `is_item_checkable()`, `is_item_checked()` and `set_item_checked()` are used regardless the item is set to look as check box or radio button. Keeping check in the name adds an additional clue about these facts. Closes #13055.
This commit is contained in:
@@ -582,6 +582,8 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const
|
||||
|
||||
theme->set_icon("checked", "PopupMenu", make_icon(checked_png));
|
||||
theme->set_icon("unchecked", "PopupMenu", make_icon(unchecked_png));
|
||||
theme->set_icon("radio_checked", "PopupMenu", make_icon(radio_checked_png));
|
||||
theme->set_icon("radio_unchecked", "PopupMenu", make_icon(radio_unchecked_png));
|
||||
theme->set_icon("submenu", "PopupMenu", make_icon(submenu_png));
|
||||
|
||||
theme->set_font("font", "PopupMenu", default_font);
|
||||
|
||||
Reference in New Issue
Block a user