diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2020-05-14 13:23:58 +0200 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2020-05-14 16:54:55 +0200 |
commit | 0be6d925dc3c6413bce7a3ccb49631b8e4a6e67a (patch) | |
tree | a27e497da7104dd0a64f98a04fa3067668735e91 /scene/gui/menu_button.cpp | |
parent | 710b34b70227becdc652b4ae027fe0ac47409642 (diff) | |
download | redot-engine-0be6d925dc3c6413bce7a3ccb49631b8e4a6e67a.tar.gz |
Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks
Which means that reduz' beloved style which we all became used to
will now be changed automatically to remove the first empty line.
This makes us lean closer to 1TBS (the one true brace style) instead
of hybridating it with some Allman-inspired spacing.
There's still the case of braces around single-statement blocks that
needs to be addressed (but clang-format can't help with that, but
clang-tidy may if we agree about it).
Part of #33027.
Diffstat (limited to 'scene/gui/menu_button.cpp')
-rw-r--r-- | scene/gui/menu_button.cpp | 14 |
1 files changed, 0 insertions, 14 deletions
diff --git a/scene/gui/menu_button.cpp b/scene/gui/menu_button.cpp index a7d1f64e93..2593784cbd 100644 --- a/scene/gui/menu_button.cpp +++ b/scene/gui/menu_button.cpp @@ -34,12 +34,10 @@ #include "scene/main/window.h" void MenuButton::_unhandled_key_input(Ref<InputEvent> p_event) { - if (disable_shortcuts) return; if (p_event->is_pressed() && !p_event->is_echo() && (Object::cast_to<InputEventKey>(p_event.ptr()) || Object::cast_to<InputEventJoypadButton>(p_event.ptr()) || Object::cast_to<InputEventAction>(*p_event))) { - if (!get_parent() || !is_visible_in_tree() || is_disabled()) return; @@ -52,7 +50,6 @@ void MenuButton::_unhandled_key_input(Ref<InputEvent> p_event) { } void MenuButton::pressed() { - { Window *w = Object::cast_to<Window>(get_viewport()); if (w && !w->is_embedding_subwindows()) { @@ -75,39 +72,31 @@ void MenuButton::pressed() { } void MenuButton::_gui_input(Ref<InputEvent> p_event) { - BaseButton::_gui_input(p_event); } PopupMenu *MenuButton::get_popup() const { - return popup; } void MenuButton::_set_items(const Array &p_items) { - popup->set("items", p_items); } Array MenuButton::_get_items() const { - return popup->get("items"); } void MenuButton::set_switch_on_hover(bool p_enabled) { - switch_on_hover = p_enabled; } bool MenuButton::is_switch_on_hover() { - return switch_on_hover; } void MenuButton::_notification(int p_what) { - if (p_what == NOTIFICATION_VISIBILITY_CHANGED) { - if (!is_visible_in_tree()) { popup->hide(); } @@ -115,7 +104,6 @@ void MenuButton::_notification(int p_what) { } void MenuButton::_bind_methods() { - ClassDB::bind_method(D_METHOD("get_popup"), &MenuButton::get_popup); ClassDB::bind_method(D_METHOD("_unhandled_key_input"), &MenuButton::_unhandled_key_input); ClassDB::bind_method(D_METHOD("_set_items"), &MenuButton::_set_items); @@ -131,12 +119,10 @@ void MenuButton::_bind_methods() { } void MenuButton::set_disable_shortcuts(bool p_disabled) { - disable_shortcuts = p_disabled; } MenuButton::MenuButton() { - switch_on_hover = false; set_flat(true); set_toggle_mode(true); |