Commit Graph

279 Commits

Author SHA1 Message Date
0d44b50520 [macOS] Add default Window and Help menus, allow special menu customization. 2023-12-13 23:20:05 +02:00
edcad2ea88 Allow auto-generated node names in PopupMenu::add_submenu_item 2023-11-09 17:12:41 +01:00
137b25cf53 Fix activate_item_by_event infinite recursion crash 2023-11-01 10:29:59 +08:00
f721b34b4e Ensure input event is valid in PopupMenu::activate_item_by_event 2023-10-25 17:45:01 +02:00
215e036600 Add bulk change guards to successive theme overrides in Editor and GUI 2023-10-19 18:14:14 +02:00
ccb989569d Fix incorrect offset of PopupMenu separator icons 2023-10-17 20:38:35 +02:00
c1fed53943 Merge pull request #80271 from Ymanawat/optionmenu-scroll-test
Fix scrolling on keyboard/controller input
2023-10-09 15:30:57 +02:00
d1aaa914f3 [macOS] Add about_to_open and popup_hide callback for the global menus, move part of logic to the PopupMenu to allow live menu modification. 2023-10-04 09:49:51 +03:00
df24882f9a Free submenu children when clearing PopupMenu 2023-09-25 16:45:41 +02:00
76fad10978 Expose PopupMenu activate_item_by_event method 2023-09-15 10:27:49 -05:00
fe000277ea Bind remaining theme properties to their respective classes
This adds binds for GraphEdit/GraphElement/GraphNode, which were
skipped before due to a rework. This also adds binds for Window,
which was skipped before due to a complicated code organization.

Also adds theme cache entries/direct cache access to a few places
that previously missed it. Some theme properties are now exposed
to other classes via friendships or public getters for convenience.

This removes all string-based theme access from scene/ classes.
2023-09-13 19:31:35 +02:00
013bbd1a1e Merge pull request #81477 from timothyqiu/aligned
Fix submenu alignment with parent menu item
2023-09-11 15:38:54 +02:00
2924bfd4d3 Register theme properties with ThemeDB 2023-09-11 13:45:23 +02:00
e5ad35a95f Fix submenu alignment with parent menu item 2023-09-09 14:32:21 +08:00
a16fdb05ae Fix scrolling popup_menu On keyboard/controller input 2023-08-30 23:31:22 +05:30
3dd881b4e4 Add option to allow echo events in menu shortcuts 2023-08-16 16:59:17 +02:00
de4a3fa151 Unify and streamline connecting to Resource changes 2023-07-17 19:35:57 +02:00
4790da7900 [macOS] Implement optional native file selection dialog support for sandboxed apps. 2023-07-12 22:36:24 +03:00
631d51c46c Merge pull request #78476 from Sauermann/fix-embedded-safe-area
Embedded Popups store their safe_rect in their embedder
2023-07-12 15:09:20 +02:00
c33748d954 Fix invalid minimum size for translated messages in option button 2023-06-29 15:01:36 +02:00
a12627765f Embedded Popups store their safe_rect in their embedder
Storing it in the DisplayServer didn't make sense in this case,
because the embedded window is unknown to the DisplayServer.
2023-06-20 18:06:26 +02:00
840e2b14f3 Remove unused variable PopupMenu::parent_rect
This private variable is not read anywhere.
Remove it and all places, where it is set.
2023-06-15 12:08:47 +02:00
0c16082e1e Use get_node_or_null when null checks are present
Avoids duplicate or unnecessary errors
2023-06-10 13:22:56 +02:00
f00c971b81 Merge pull request #63168 from Levrault/master
Fix: InputEventJoypadMotion should trigger only once on a vslider
2023-06-05 18:04:39 +02:00
166ca77f20 feat(gamepad): improve gamepad behavior with slider and popup_menu 2023-06-05 10:20:46 -04:00
6a1d3198d1 Merge pull request #76854 from CapitaineCookie/fix-change-type
Fix crash when changing node type from PopupMenu to ItemList
2023-06-02 13:03:55 +02:00
44a5b710f5 Unify item indexing in PopupMenu 2023-05-24 15:58:50 +02:00
999a1fffec Fix crash when changing node type from PopMenu to ItemList 2023-05-12 23:29:52 +02:00
a85eef4367 Add icon_modulate functionality to PopupMenu 2023-05-08 15:25:00 -07:00
1522762dc9 Make icons of scripted and custom classes fit the editor UI
Also:
- Add an option to limit the icon size in PopupMenu.
This is similar to how this works in Tree and TreeItem.
- Add the same option to TabBar.
- Add a theme constant for Tree, PopupMenu, Button, and
TabBar to apply this limit on the control level.

Co-authored-by: Daylily-Zeleen <daylily-zeleen@foxmail.com>
2023-03-31 21:39:02 +02:00
cebfc02d6f Revert "Reordering emitted signals in PopupMenu" and fix editor selection issue in the safer way. 2023-02-24 21:17:05 +02:00
5928d801a9 Reordering emitted signals in PopupMenu 2023-02-17 23:18:56 +07:00
b7723a01d9 Merge pull request #66745 from EricEzaM/66453-popupmenu-shortcut-shape-fix
Ensure PopupMenu item is shaped when the shortcut is set.
2023-02-13 09:29:41 +01:00
9f42649823 [X11] Fix IME subwindow in the popup not getting input focus. 2023-02-01 11:10:10 +02:00
752402cf35 Clean-up, harmonize, and improve StyleBox API
- Make all margin properties follow the same naming convention (their getter and setter too).
- Remove a virtual counterpart of `get_style_margin` from API.
- Allow to override `get_minimum_size` from scripting and remove `get_center_size`.
2023-01-19 20:02:21 +03:00
0e0a6bb39b Removed unused property hints and Object::get_translatable_strings()
* Remove unused `EditorPropertyMember` and related hints, previouly used by
  VisualScript. Such logic should be implemented in the VS module itself.
* As the above broke compatibility with the VS module, clean up the other
  hacks that were still in core in support of VisualScript.
* `PROPERTY_USAGE_INTERNATIONALIZED` was only used in Object's
  `get_translatable_strings()`, which is a legacy function not used anywhere.
  So both are removed.
* Reordered some usage flags after the above removal to minimize the diff.
* General clean up.

Fixes #30203.

Co-authored-by: Rémi Verschelde <rverschelde@gmail.com>
2023-01-09 16:56:01 +01:00
2b815df3c1 Use BitField<> in core type masks
* All core types masks are now correctly marked as bitfields.
* The enum hacks in MouseButtonMask and many other types are gone. This ensures that binders to other languages non C++ can actually implement type safe bitmasks.
* Most bitmask operations replaced by functions in BitField<>
* Key is still a problem because its enum and mask at the same time. While it kind of works in C++, this most likely can't be implemented safely in other languages and will have to be changed at some point. Mostly left as-is.
* Documentation and API dump updated to reflect bitfields in core types.
2023-01-08 22:17:40 +01:00
d95794ec8a One Copyright Update to rule them all
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".
2023-01-05 13:25:55 +01:00
02e9134183 Fix menu popup safe rect height no including theme separation. 2022-12-07 08:21:27 +02:00
3b14f0334c Remove redundant Variant-types initializations 2022-11-14 19:35:19 +01:00
d9f066d5fa Remove duplicate project settings definitions 2022-11-08 01:29:39 +01:00
61ad9db18c Ensure PopupMenu item is shaped when the shortcut is set. 2022-10-22 22:05:20 +10:00
2ffb609658 Merge pull request #66337 from EricEzaM/sprite-frames
Ensure control built-in shortcuts are matched exactly & add shortcuts for SpriteFrames editor
2022-10-13 15:24:39 +02:00
0103af1ddd Fix MSVC warnings, rename shadowed variables, fix uninitialized values, change warnings=all to use /W4. 2022-10-07 11:32:33 +03:00
af438ae742 Ensure popup menu redraws items when shortcuts update. 2022-09-26 23:21:32 +10:00
2eda77c682 Ensure all checks of is_action in the editor which are for 'shortcut' use, check the action exactly. 2022-09-24 18:01:02 +10:00
9507e91c07 Rename PopupMenu's set/get_current_index() to set/get_focused_item() 2022-09-06 10:51:14 -03:00
15d057c521 Add is_zero_approx methods to Vector2, 3, and 4 2022-09-02 00:29:50 -04:00
15fd025f90 Add dumb and manual theme caching systems to Window 2022-09-01 16:05:02 +03:00
e31bb5ffeb Rename CanvasItem.update() to queue_redraw()
Affects a lot of classes. Very thoroughly checked signal connections and deferred calls to this method, add_do_method/add_undo_method calls, and so on.

Also renames the internal `_update_callback()` to `_redraw_callback()` for consistency.

Just a few comments have also been changed to say "redraw".

In CPUParticles2D, there was a private variable with the same name. It has been renamed to `do_redraw`.
2022-08-29 14:59:47 +02:00