summaryrefslogtreecommitdiff
path: root/scene/gui/popup_menu.cpp
AgeCommit message (Collapse)Author
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
2020-03-26Refactored input, goes all via windows now.Juan Linietsky
Also renamed Input to InputFilter because all it does is filter events.
2020-03-26Refactored Input, create DisplayServer and DisplayServerX11Juan Linietsky
2020-03-01Merge pull request #18020 from bruvzg/input_fix_non_latin_and_add_hw_scancodesRémi Verschelde
Fix non-latin layout scancodes on Linux, adds access to physical scancodes.
2020-02-28Signals: Manually port most of remaining connect_compat usesRémi Verschelde
It's tedious work... Some can't be ported as they depend on private or protected methods of different classes, which is not supported by callable_mp (even if it's a class inherited by the current one).
2020-02-28Signals: Port connect calls to use callable_mpRémi Verschelde
Remove now unnecessary bindings of signal callbacks in the public API. There might be some false positives that need rebinding if they were meant to be public. No regular expressions were harmed in the making of this commit. (Nah, just kidding.)
2020-02-25Variant: Added 64-bit packed arrays, renamed Variant::REAL to FLOAT.Juan Linietsky
- Renames PackedIntArray to PackedInt32Array. - Renames PackedFloatArray to PackedFloat32Array. - Adds PackedInt64Array and PackedFloat64Array. - Renames Variant::REAL to Variant::FLOAT for consistency. Packed arrays are for storing large amount of data and creating stuff like meshes, buffers. textures, etc. Forcing them to be 64 is a huge waste of memory. That said, many users requested the ability to have 64 bits packed arrays for their games, so this is just an optional added type. For Variant, the float datatype is always 64 bits, and exposed as `float`. We still have `real_t` which is the datatype that can change from 32 to 64 bits depending on a compile flag (not entirely working right now, but that's the idea). It affects math related datatypes and code only. Neither Variant nor PackedArray make use of real_t, which is only intended for math precision, so the term is removed from there to keep only float.
2020-02-25Rename `scancode` to `keycode`.bruvzg
Add `physical_keycode` (keyboard layout independent keycodes) to InputEventKey and InputMap. Fix non-latin keyboard layout keycodes on Linux/X11 (fallback to physical keycodes).
2020-02-20Reworked signal connection system, added support for Callable and Signal ↵Juan Linietsky
objects and made them default.
2020-02-11Texture refactorJuan Linietsky
-Texture renamed to Texture2D -TextureLayered as base now inherits 2Darray, cubemap and cubemap array -Removed all references to flags in textures (they will go in the shader) -Texture3D gone for now (will come back later done properly) -Create base rasterizer for RenderDevice, RasterizerRD
2020-01-03Clears button mask before activating menu itemHaoyu Qiu
2020-01-01Update copyright statements to 2020Rémi Verschelde
Happy new year to the wonderful Godot community! We're starting a new decade with a well-established, non-profit, free and open source game engine, and tons of further improvements in the pipeline from hundreds of contributors. Godot will keep getting better, and we're looking forward to all the games that the community will keep developing and releasing with it.
2019-12-13doc: Sync classref with current sourceRémi Verschelde
Also apply clang-format.
2019-12-10Fixes long popup menu scroll behaviorHaoyu Qiu
Popup menus longer than the viewport have stange behaviors before this fix: * They always have one pixel outside the viewport. * You can scroll down the long menu even if bottom outside screen and top inside the screen. (Only menus one pixel above the screen is limited to scroll down.)
2019-10-08PopupMenu: Fix missing text/xl_text when using add_shortcutRémi Verschelde
Use macros to ensure that `text`, `xl_text` and `id` are always set using the same logic. Fixes #25519. Also fixes up #26914 when `p_id == -1` handling was only added for a couple methods instead of all of them.
2019-10-08PopupMenu: Reorder add_* methods in more natural orderRémi Verschelde
Also adds `add_icon_radio_check_shortcut` matching `add_icon_radio_check_item`, binds them for scripting languages, and binds `add_multistate_item`.
2019-08-09Remove ERR_EXPLAIN from scene/* codeTomasz Chabora
2019-05-31Improvements to incremental searchTomasz Chabora
2019-05-09Change "ID" to lowercase "id"Aaron Franke
Reasoning: ID is not an acronym, it is simply short for identification, so it logically should not be capitalized. But even if it was an acronym, other acronyms in Godot are not capitalized, like p_rid, p_ip, and p_json.
2019-05-02Fix regression in 'PopupMenu' when icons have different values for width and ↵Michael Alexsander Silva Dias
height
2019-05-01Fix regression on 'PopupMenu's minimal sizeMichael Alexsander Silva Dias
2019-04-30Merge pull request #27204 from YeldhamDev/popupmenu_checkicon_offsetRémi Verschelde
Offset items in PopupMenu when Icons and Checks are present
2019-04-29Make buttons that trigger popups have the same scaleMichael Alexsander Silva Dias
2019-04-22Merge pull request #27673 from qarmin/small_fixesRémi Verschelde
Small fixes, mostly duplicated code
2019-04-08Small fixes, mostly dupicated codeqarmin
2019-03-18Offset items in PopupMenu when Icons and Checks are presentMichael Alexsander Silva Dias
2019-03-11Fixed optional idx argument in add_item (OptionMeny & PopupMenu)xDGameStudios
2019-02-20Add -Wshadow=local to warnings and fix reported issues.marxin
Fixes #25316.
2019-02-15Revert "Fix MenuButton item label disappearing when setting shortcut."Rémi Verschelde
2019-02-14Fix MenuButton item label disappearing when setting shortcut.Unknown
2019-01-01Update copyright statements to 2019Rémi Verschelde
Happy new year to the wonderful Godot community!
2018-12-15Fix item highlighting in PopupMenu for items with offsetMichael Alexsander Silva Dias
2018-11-11Fixed various uninitialised member variables in editor plugins.Ibrahn Sahir
2018-11-08-Moved EditorDefaultValue to ClassDB, made it coreJuan Linietsky
-Removed one and zero hints for properties, replaced by default value
2018-11-01Merge pull request #21962 from YeldhamDev/switch_hover_submenuJuan Linietsky
Fix MenuButton hover switching not happening with submenus open
2018-09-12Make core/ includes absolute, remove subfolders from include pathRémi Verschelde
This allows more consistency in the manner we include core headers, where previously there would be a mix of absolute, relative and include path-dependent includes.
2018-09-11Fix MenuButton hover switching not happening with submenus openMichael Alexsander Silva Dias
2018-08-17Merge pull request #21091 from hpvb/fix-removing-popup-menu-itemRémi Verschelde
Call minimum_size_changed() in PopupMenu::remove_item()
2018-08-16Call minimum_size_changed() in PopupMenu::remove_item()Hein-Pieter van Braam
When removing an item from a PopupMenu we need to update the control's size cache otherwise the size of the PopupMenu itself lags behind by 1 item size. Meaning the PopupMenu will remain too large.