summaryrefslogtreecommitdiff
path: root/scene/gui/popup.cpp
AgeCommit message (Collapse)Author
2023-01-05One Copyright Update to rule them allRémi Verschelde
As many open source projects have started doing it, we're removing the current year from the copyright notice, so that we don't need to bump it every year. It seems like only the first year of publication is technically relevant for copyright notices, and even that seems to be something that many companies stopped listing altogether (in a version controlled codebase, the commits are a much better source of date of publication than a hardcoded copyright statement). We also now list Godot Engine contributors first as we're collectively the current maintainers of the project, and we clarify that the "exclusive" copyright of the co-founders covers the timespan before opensourcing (their further contributions are included as part of Godot Engine contributors). Also fixed "cf." Frenchism - it's meant as "refer to / see".
2022-10-11Prevent `Popup`s it the edited scene tree from closing on focus loss. Hide ↵bruvzg
irrelevant `Popup` flags from the editor inspector.
2022-10-07Fix MSVC warnings, rename shadowed variables, fix uninitialized values, ↵bruvzg
change warnings=all to use /W4.
2022-09-01Add dumb and manual theme caching systems to WindowYuri Sizov
2022-08-29Revert "Remove NOTIFICATION_ENTER_TREE when paired with ↵Rémi Verschelde
NOTIFICATION_THEME_CHANGED" This reverts commit 4b817a565cab8af648c88cfc7ab6481e86ee3625. Fixes #64988. Fixes #64997. This caused several regressions (#64988, #64997, https://github.com/godotengine/godot/issues/64997#issuecomment-1229970605) which point at a flaw in the current logic: - `Control::NOTIFICATION_ENTER_TREE` triggers a *deferred* notification with `NOTIFCATION_THEME_CHANGED` as introduced in #62845. - Some classes use their `THEME_CHANGED` to cache theme items in member variables (e.g. `style_normal`, etc.), and use those member variables in `ENTER_TREE`, `READY`, `DRAW`, etc. Since the `THEME_CHANGE` notification is now deferred, they end up accessing invalid state and this can lead to not applying theme properly (e.g. for EditorHelp) or crashing (e.g. for EditorLog or CodeEdit). So we need to go back to the drawing board and see if `THEME_CHANGED` can be called earlier so that the previous logic still works? Or can we refactor all engine code to make sure that: - `ENTER_TREE` and similar do not depend on theme properties cached in member variables. - Or `THEME_CHANGE` does trigger a general UI update to make sure that any bad theme handling in `ENTER_TREE` and co. gets fixed when `THEME_CHANGE` does arrive for the first time. But that means having a temporary invalid (and possibly still crashing) state, and doing some computations twice which might be heavy (e.g. `EditorHelp::_update_doc()`).
2022-08-27Remove NOTIFICATION_ENTER_TREE when paired with NOTIFICATION_THEME_CHANGEDAaron Record
2022-06-13Single-window mode popups and edited scene windows fixes.bruvzg
Fix single-window mode popup not closing when OptionBox is clicked. Fix single-window mode submenus closing when parent menu item, that was used to open it is clicked (using same safe-area logic as platform specific code). Disallow windows that are part of an edited scene from being set as exclusive or popup to prevent it from locking up the editor.
2022-05-13popup deferred hide suppressed if reopenedderammo
popup no longer tries to close itself a second time popup no longer closes after having been reopened fixed bug in RenameDialog not calling base (by inspection) fixes #59181 fixes #60921 reverts #59287
2022-03-06Remove set_as_minsize()kobewi
2022-02-25Improve popup window handling.bruvzg
Add window FLAG_POPUP and a platform specific routines to control popup auto-hiding and event forwarding.
2022-02-15Use `switch` consistently in `_notification` (`scene` folder)Rémi Verschelde
2022-02-08Revert "Add missing SNAME macro optimization to all theme methods call"Rémi Verschelde
This reverts commit a988fad9a092053434545c32afae91ccbdfbe792. As discussed in #57725 and clarified in #57788, `SNAME` is not meant to be used everywhere but only in critical code paths. For theme methods specifically, it was by design that only getters use `SNAME` and not setters.
2022-02-06Add missing SNAME macro optimization to all theme methods calljmb462
2022-01-03Update copyright statements to 2022Rémi Verschelde
Happy new year to the wonderful Godot community!
2021-11-12Use "enum class" for input enumsAaron Franke
2021-10-31Fix popup trying to emit a non existing signal when closedHungryProton
2021-09-23Merge pull request #51920 from ↵Rémi Verschelde
jmb462/missing-sname-macro-optimization-in-some-functions
2021-08-28Add support for internal nodeskobewi
2021-08-20Add missing SNAME macro optimization for StringName in some functionsjmb462
2021-07-21Fix logic for Popup closing when parent is focusedPouleyKetchoupp
The member popped_up is used to avoid closing a Popup before it had a chance to be focused. It wasn't reset properly when the popup is hidden, causing the Popup to close right after showing in some random cases (spotted on X11, might not happen on Windows).
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-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-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-10-01Renamed toplevel to be top_levelDuroxxigar
2020-09-03Merge pull request #41456 from nekomatata/x11-fix-popupsRémi Verschelde
Popup fixes for X11 display server
2020-09-01PopupMenu rework and enhancementsEricEzaM
Many scrolling behaviour improvements and the ability to limit popup size.
2020-08-22Fix popup closed when an ancestor window is focusedPouleyKetchoupp
Previously, only the direct parent were taken into account. Popups like contextual menus could stay open if an ancestor which is not a direct parent was focused. Reproduction steps (any platform): - Select a node in the scene tree - Left click the node to start renaming - Right click to open the copy/paste contextual menu - Left click in the scene tree to deselect the node Also closing popup when focusing out of the application, without waiting for the parent to get focus to do so.
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-03-26Reworked tooltips to use the popup system.Juan Linietsky
2020-03-26Popups have also been converted to windowsJuan Linietsky
Controls using the old modal API have been replaced to use popups.
2020-03-26Popups are now windows also (broken!)Juan Linietsky
2020-03-26Working multiple window support, including editorJuan Linietsky
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-08-14Merge pull request #31267 from sparkart/fix_optionbutton_offsetRémi Verschelde
Fix Offset with OptionButton Popup
2019-08-14Exposed set_as_minsize to gdscriptFabian
2019-08-12Fix Offset with OptionButton PopupEmmanuel Barroga
Fixes the offset issue with the OptionButton's popup.
2019-07-09Improve the node configuration warning displayHugo Locurcio
- Refer to properties explicitly when possible - When multiple warnings are returned, always separate them by one blank line to make them easier to distinguish - Improve grammar and formatting
2019-07-06Fix editor remaining dimmed after certain actionsBojidar Marinov
Fixes #30368
2019-06-25Fix Popup::popup_centered not centering at the first callGuilherme Felipe
2019-05-28Merge pull request #28454 from homer666/popup-centered-maxsizeRémi Verschelde
Add `popup_centered_clamped()` method to Popup
2019-04-30Add Popup::popup_centered_clamped methodhomer666
- Also replace redundant duplicate code in editor dialogs with calls to popup_centered_clamped()
2019-04-29Make buttons that trigger popups have the same scaleMichael Alexsander Silva Dias
2019-02-13Fix button alignment of Package Installer on OSXNaoto Kondo
This problem occurs only in the HiDPI environment.
2019-01-14Hide visible popups by default if visible when entering tree, unless on ↵Juan Linietsky
editor. Fixes #24737
2019-01-01Update copyright statements to 2019Rémi Verschelde
Happy new year to the wonderful Godot community!
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.