Skip to content

Commit

Permalink
Treat MenuBar and MenuButton as advanced UI
Browse files Browse the repository at this point in the history
  • Loading branch information
AThousandShips committed Aug 28, 2024
1 parent f648de1 commit 2d2fb3f
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 8 deletions.
3 changes: 0 additions & 3 deletions scene/gui/menu_bar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -680,10 +680,7 @@ void MenuBar::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_menu_hidden", "menu", "hidden"), &MenuBar::set_menu_hidden);
ClassDB::bind_method(D_METHOD("is_menu_hidden", "menu"), &MenuBar::is_menu_hidden);

// TODO: Properly handle popups when advanced GUI is disabled.
#ifndef ADVANCED_GUI_DISABLED
ClassDB::bind_method(D_METHOD("get_menu_popup", "menu"), &MenuBar::get_menu_popup);
#endif // ADVANCED_GUI_DISABLED

ADD_PROPERTY(PropertyInfo(Variant::BOOL, "flat"), "set_flat", "is_flat");
ADD_PROPERTY(PropertyInfo(Variant::INT, "start_index"), "set_start_index", "get_start_index");
Expand Down
3 changes: 0 additions & 3 deletions scene/gui/menu_button.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -173,10 +173,7 @@ bool MenuButton::_get(const StringName &p_name, Variant &r_ret) const {
}

void MenuButton::_bind_methods() {
// TODO: Properly handle popups when advanced GUI is disabled.
#ifndef ADVANCED_GUI_DISABLED
ClassDB::bind_method(D_METHOD("get_popup"), &MenuButton::get_popup);
#endif // ADVANCED_GUI_DISABLED
ClassDB::bind_method(D_METHOD("show_popup"), &MenuButton::show_popup);
ClassDB::bind_method(D_METHOD("set_switch_on_hover", "enable"), &MenuButton::set_switch_on_hover);
ClassDB::bind_method(D_METHOD("is_switch_on_hover"), &MenuButton::is_switch_on_hover);
Expand Down
4 changes: 2 additions & 2 deletions scene/register_scene_types.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -402,8 +402,6 @@ void register_scene_types() {
GDREGISTER_CLASS(VSlider);
GDREGISTER_CLASS(Popup);
GDREGISTER_CLASS(PopupPanel);
GDREGISTER_CLASS(MenuBar);
GDREGISTER_CLASS(MenuButton);
GDREGISTER_CLASS(CheckBox);
GDREGISTER_CLASS(CheckButton);
GDREGISTER_CLASS(LinkButton);
Expand Down Expand Up @@ -458,6 +456,8 @@ void register_scene_types() {
GDREGISTER_CLASS(CodeHighlighter);

GDREGISTER_ABSTRACT_CLASS(TreeItem);
GDREGISTER_CLASS(MenuBar);
GDREGISTER_CLASS(MenuButton);
GDREGISTER_CLASS(OptionButton);
GDREGISTER_CLASS(SpinBox);
GDREGISTER_CLASS(ColorPicker);
Expand Down

0 comments on commit 2d2fb3f

Please sign in to comment.