summaryrefslogtreecommitdiff
path: root/scene/gui/popup_menu.cpp
AgeCommit message (Collapse)Author
2021-08-23Entirely removes BIND_VMETHOD in favor of GDVIRTUALreduz
* `_gui_input`, `_input`, `_unhandled_input` and `_unhandled_key_input` are now regular C++ virutal functions. * Everything else converted to GDVIRTUAL * BIND_VMETHOD is gone, always use the new syntax from now on. Creating `_gui_input` method and using the binder to register events will no longer work, simply override the virtual function now.
2021-08-19fixed popup_menu buttons getting triggered by lmb press instead of release.ThreeRhinosInAnElephantCostume
2021-08-10Use Key enum instead of plain integersAaron Franke
2021-08-05Shortcut: Rename `shortcut` property to `event`Rémi Verschelde
Having a property which has the same name as its class leads to confusing situations (e.g. `BaseButton` has a `shortcut` property of type `Shortcut` which has a `shortcut` property of type `InputEvent`). Also renames `is_event` to `matches_event`, and `is_valid` to `has_valid_event` to better reflect what the methods check.
2021-07-29Add `auto_translate` toggle for automatic translationMichael Alexsander
2021-07-25Use const references where possible for List range iteratorsRémi Verschelde
2021-07-23Use C++ iterators for Lists in many situationsAaron Franke
2021-07-23Fix popup submenu in single-window modejfons
The internal processing code only works for OS windows, since it takes the mouse position relative to the window and not the viewport. Now we make sure it's not called in single-window mode.
2021-07-18Optimize StringName usagereduz
* Added a new macro SNAME() that constructs and caches a local stringname. * Subsequent usages use the cached version. * Since these use a global static variable, a second refcounter of static usages need to be kept for cleanup time. * Replaced all theme usages by this new macro. * Replace all signal emission usages by this new macro. * Replace all call_deferred usages by this new macro. This is part of ongoing work to optimize GUI and the editor.
2021-05-07Rename "Control" key to "Ctrl" and add "_pressed" suffix to all ↵Lightning_A
InputEventWithModifiers properties/methods
2021-04-05Fix crashes in *_input functionsRafał Mikrut
2021-03-23Rename ButtonList enum and members to MouseButtonAaron Franke
2021-03-20Fix wrong width with PopupMenus on first opening in the editorMichael Alexsander
2021-03-12Fixes small typos and grammar correctionAnshul7sp1
2021-02-16Fix various small issues with PopupMenuMichael Alexsander
2021-02-15Improved PopupMenu visuals. Removed x-y margin, made it 'padding' instead.Eric M
2021-02-14[CTL] Add missing font outline drawing routines and theme constants.bruvzg
2021-02-09Initialize class variables with default values in scene/ [2/2]Rafał Mikrut
2021-01-24Change themes *_color_* to *_*_colorMarcel Admiraal
Changed: font_color_accel -> font_accelerator_color font_color_bg -> font_unselected_color font_color_disabled -> font_disabled_color font_color_fg -> font_selected_color font_color_hover -> font_hover_color font_color_hover_pressed -> font_hover_pressed_color font_color_pressed -> font_pressed_color font_color_readonly -> font_readonly_color font_color_selected -> font_selected_color font_color_shadow -> font_shadow_color font_color_uneditable -> font_uneditable_color icon_color_disabled -> icon_disabled_color icon_color_hover -> icon_hover_color icon_color_hover_pressed -> icon_hover_pressed_color icon_color_normal -> icon_normal_color icon_color_pressed -> icon_pressed_color Also includes: font_outline_modulate -> font_outline_color tab_fg -> tab_selected tab_bg -> tab_unselected
2021-01-04Merge pull request #44906 from ↵Rémi Verschelde
EricEzaM/PR/popup-menu-fix-not-matching-button-size Fixed PopupMenu not matching parent MenuButton/OptionButton width
2021-01-04Fixed PopupMenu not matching parent MenuButton/OptionButton widthEric M
2021-01-04Fixed hover highlight style rect of items being cut off.Eric M
This was caused by an incorrect calculation of the height of each item when determining the minimum size, plus a few things which were leftover after the PopupMenu rework.
2021-01-01Update copyright statements to 2021Rémi Verschelde
Happy new year to the wonderful Godot community! 2020 has been a tough year for most of us personally, but a good year for Godot development nonetheless with a huge amount of work done towards Godot 4.0 and great improvements backported to the long-lived 3.2 branch. We've had close to 400 contributors to engine code this year, authoring near 7,000 commit! (And that's only for the `master` branch and for the engine code, there's a lot more when counting docs, demos and other first-party repos.) Here's to a great year 2021 for all Godot users 🎆
2020-12-27Added optional id parameter to `PopupMenu::add_separator`Yuri Roubinsky
2020-12-23Rename Control margin to offsetMarcel Admiraal
2020-12-10Allow to circle back in 'PopupMenu' even if the first/last item is ↵Michael Alexsander
non-selectable
2020-12-10Merge pull request #44233 from YeldhamDev/popupmenu_circle_backRémi Verschelde
Re-add circle back scrolling to 'PopupMenu'
2020-12-09Re-add circle back scrolling to 'PopupMenu'Michael Alexsander
2020-12-03Add "font_color_separator" theme property to 'PopupMenu'Michael Alexsander
2020-11-26[Complex Text Layouts] Refactor Font class, default themes and controls to ↵bruvzg
use Text Server interface. Implement interface mirroring. Add TextLine and TextParagraph classes. Handle UTF-16 input on macOS and Windows.
2020-11-16Merge pull request #41851 from EricEzaM/PR/popup-menu-hysteresisRémi Verschelde
Added hysteresis for popup sub-menus
2020-11-08Added hysteresis for popup sub-menusEric M
This adds a small lag effect when opening submenus which allow the user to move directly to an item on the submenu without worrying about avoiding the autohide regions.
2020-11-07Reorganized core/ directory, it was too fatty alreadyreduz
-Removed FuncRef, since Callable makes it obsolete -Removed int_types.h as its obsolete in c++11+ -Changed color names code
2020-09-18Fix popup menu item selected when opening the menuPouleyKetchoupp
In order to allow selecting items by either holding left click, or click to open and click again to select, mouse button release was invalidated based on the amount of mouse motion. This was causing issues in some scenarios where an item could be selected while opening the menu if the mouse moved enough between button press and release. This case could happen in the language selection of the project manager, especially on linux, because of the order and timing of the mouse events on x11. This change invalidates mouse release based on a timing condition rather than moved distance to handle any case from the display server properly.
2020-09-09Rename ShortCut to Shortcut which is more grammatically correctHugo Locurcio
See https://github.com/godotengine/godot/issues/16863#issuecomment-685236980.
2020-09-06Fixed get_usable_parent_rect() errors when initialising popup menus.Eric M
2020-09-02Fix PopupMenu unresponsive on right side of menuNathan Franke
2020-09-01PopupMenu rework and enhancementsEricEzaM
Many scrolling behaviour improvements and the ability to limit popup size.
2020-05-17Allow searching with keyboard input by default in PopupMenuHugo Locurcio
See discussion in https://github.com/godotengine/godot-proposals/issues/43.
2020-05-14Style: Enforce braces around if blocks and loopsRémi Verschelde
Using clang-tidy's `readability-braces-around-statements`. https://clang.llvm.org/extra/clang-tidy/checks/readability-braces-around-statements.html
2020-05-14Style: Enforce separation line between function definitionsRémi Verschelde
I couldn't find a tool that enforces it, so I went the manual route: ``` find -name "thirdparty" -prune \ -o -name "*.cpp" -o -name "*.h" -o -name "*.m" -o -name "*.mm" \ -o -name "*.glsl" > files perl -0777 -pi -e 's/\n}\n([^#])/\n}\n\n\1/g' $(cat files) misc/scripts/fix_style.sh -c ``` This adds a newline after all `}` on the first column, unless they are followed by `#` (typically `#endif`). This leads to having lots of places with two lines between function/class definitions, but clang-format then fixes it as we enforce max one line of separation. This doesn't fix potential occurrences of function definitions which are indented (e.g. for a helper class defined in a .cpp), but it's better than nothing. Also can't be made to run easily on CI/hooks so we'll have to be careful with new code. Part of #33027.
2020-05-14Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocksRémi Verschelde
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.
2020-05-06PopupMenu.get_current_index() bound to ClassDBnobuyuki_nyuu
2020-04-28Rename InputFilter back to InputRémi Verschelde
It changed name as part of the DisplayServer and input refactoring in #37317, with the rationale that input no longer goes through the main loop, so the previous Input singleton now only does filtering. But the gains in consistency are quite limited in the renaming, and it breaks compatibility for all scripts and tutorials that access the Input singleton via the scripting language. A temporary option was suggested to keep the scripting singleton named `Input` even if its type is `InputFilter`, but that adds inconsistency and breaks C#. Fixes godotengine/godot-proposals#639. Fixes #37319. Fixes #37690.
2020-04-02Merge pull request #37504 from qarmin/out_of_bound_cursorRémi Verschelde
Fix array out of bounds access caused by uninitialised variables
2020-04-01Fix out of bound array access caused by unassigned variableRafał Mikrut
2020-03-30fixed PopupMenus letterjumping on any InputEventLeleat
2020-03-26Popups have also been converted to windowsJuan Linietsky
Controls using the old modal API have been replaced to use popups.
2020-03-26Open sub-windows as embedded if the OS does not support themJuan Linietsky
2020-03-26Popups are now windows also (broken!)Juan Linietsky