Commit Graph

859 Commits

Author SHA1 Message Date
b61499353f Fix error when embedded window is closed while resizing 2025-02-06 17:05:06 -05:00
654b5993e2 Merge pull request #99890 from Sauermann/fix-vp-mouse-notifications
Introduce `Viewport` functions for keeping the mouse over state consistent
2025-02-03 11:14:42 -06:00
949f707ad9 Fix ViewportTexture::get_size 2025-01-21 20:50:42 +08:00
65cf7c1d5e Merge pull request #101221 from bruvzg/win_dec_exp
[Window] Expose `start_drag` and `start_resize` methods (for both native and embedded windows).
2025-01-09 11:17:24 +01:00
b194e050d7 Merge pull request #91333 from YeldhamDev/working_on_this_felt_like_constantly_walking_into_rakes
Make `PopupMenu/Panel` shadows properly visible again
2025-01-07 23:17:02 +01:00
8d911b2554 [Window] Expose start_drag and start_resize methods (for both native and embedded windows). 2025-01-07 23:35:14 +02:00
11dc4f2e5e Metal: Add MetalFX upscaling support
Co-authored-by: Hugo Locurcio <hugo.locurcio@hugo.pro>
2025-01-06 06:03:18 -07:00
73d85f46c9 Remove unused headers in scene.
Co-authored-by: Thaddeus Crews <repiteo@outlook.com>

Co-authored-by: A Thousand Ships <96648715+AThousandShips@users.noreply.github.com>
2024-12-24 00:40:09 +08:00
0bc2c269cb Fix blurred content of embedded windows 2024-12-20 22:44:36 +08:00
a6e89ba2ba Merge pull request #80121 from Sauermann/fix-embedded-window-stretch
Fix display of embedded `Window`
2024-12-19 20:00:17 -06:00
cbfc34d279 Merge pull request #100444 from Sauermann/fix-view-panner-mouse-warp
Fix `ViewPanner` panning-mouse-warp
2024-12-19 20:00:01 -06:00
4887172a59 Fix ViewPanner panning mouse warp
Currently the mouse cursor jumps in unexpected ways, when a `ViewPanner`
is used in SubViewports or embedded Windows.

This is caused by providing wrong coordinate systems to
Input::warp_mouse_motion.

This PR replaces the use of `Input::warp_mouse_motion` with
`Viewport::wrap_mouse_in_rect` and makes sure, that the correct
coordinate systems are used.

This change makes it necessary, that all classes, that currently
use ViewPanner, need to provide the correct Viewport to ViewPanner.
2024-12-20 00:28:49 +01:00
98ca63ae47 Merge pull request #99849 from Sauermann/fix-menu-button-hover
Fix `switch_on_hover` for `MenuButton`
2024-12-17 16:19:03 +01:00
d60c0e21a6 Merge pull request #88313 from wagnerfs/run-time-anisotropic-filtering
Allow changing the anisotropic filter level at run-time per Viewport
2024-12-17 16:18:38 +01:00
0eff41d045 Fix displaying of embedded Window
Fix Rect of texture to take window and stretch transform into account.

There is no need for `viewport_attach_to_screen` for embedded windows,
since their display is handled via `Viewport::_sub_window_update`.
2024-12-17 08:38:14 +01:00
9c5886f95a Fix switch_on_hover for MenuButton
Previously, embedded Windows (the opened menu) were not accounted for
when checking for `switch_on_hover`.

`gui_get_hovered_control()` is more appropriate to check for the hover
status of other `MenuButton` nodes at the mouse position.

Explain the usage of the incorrectly used function in a comment.
2024-12-16 22:11:42 +01:00
4e19ab8afe Fix connecting a signal with a double click is too difficult
Co-authored-by: Danil Alexeev <dalexeev12@yandex.ru>
2024-12-14 16:18:34 +03:00
bfc66f0608 Merge pull request #100282 from devloglogan/motion-vectors-openxr
Add renderer motion vectors API for use with OpenXR
2024-12-12 16:13:36 -06:00
26fec37389 Merge pull request #99942 from kitbdev/fix-invisible-subviewport-editor
Fix selecting and editing invisble items in SubViewports
2024-12-12 14:10:09 +01:00
4d6a6b21e2 Allow canceling drag-and-drop with right mouse button
This is a small usability enhancement, that allows users to cancel
drag-and-drop without the need to press the escape key on the keyboard.
2024-12-11 00:13:54 +01:00
3deb5884d7 Renderer agnostic motion vector rendering/OpenXR changes 2024-12-10 15:59:17 -06:00
09dd5e6b20 Merge pull request #98032 from zaevi/fix_drag_preview_position
Fix incorrect drag preview position under transformed `CanvasLayer`.
2024-12-09 14:33:36 -06:00
kit
93e06ff16c Fix select and edit invisble items in SubViewports 2024-12-02 17:12:51 -05:00
f7f6432af6 Make PopupMenu/Panel shadows properly visible again 2024-12-02 14:20:58 -03:00
d58b2e879f Get rid of easily removable uses of const_cast 2024-12-01 17:50:13 -08:00
8e00035f08 Introduce Viewport functions for keeping the mouse over state consistent 2024-12-01 11:22:11 +01:00
6995b6a03e Allow changing the anisotropic filter level at run-time per Viewport 2024-11-30 00:50:45 -03:00
16ee94a953 Merge pull request #99843 from KoBeWi/easy_windows
Add helper method to get Window from ID
2024-11-29 22:51:45 +01:00
05e93a6010 Merge pull request #99691 from Sauermann/fix-consume-mouse-over
Rename `SubViewportContainer` option `consume_drag_and_drop` to `mouse_target`
2024-11-29 22:51:10 +01:00
e0304a7d00 Add helper method to get Window from ID 2024-11-29 21:15:23 +01:00
f53a220a72 Fix physics picking when hovering an embedded window
When the mouse is hovering an embedded window, it is still considered
within the main viewport.
Previously in this case physics picking was executed, as if no embedded
window was there.

This PR introduces an additional check to exclude these cases.
2024-11-27 22:29:42 +01:00
9c300a6c05 Merge pull request #80965 from Calinou/viewport-add-get-stretch-scale-factor
Add a Viewport method to get automatically computed 2D stretch transform
2024-11-27 10:47:12 -06:00
003647972f Rename consume_drag_and_drop to mouse_target
The functionality of the parameter is not limited to drag-and-drop
operations, but it has also other uses.
So its name should not be tied to drag-and-drop.

The API was created in the not yet released Godot 4.4-dev6, so this
change should not be considered compatibility breaking.
2024-11-25 21:36:29 +01:00
0eca686191 Merge pull request #99270 from Sauermann/fix-svc-drop-config
Introduce a `SubViewportContainer` config for drag-and-drop target locations
2024-11-21 17:56:48 -06:00
285954659d Merge pull request #96721 from aXu-AP/tooltip-distance
Fix tooltip appearing in old place, on movement
2024-11-20 17:03:08 +01:00
0cf99cf95d Add a Viewport method to get automatically computed 2D stretch transform
`Viewport.get_stretch_transform()` returns the automatically computed
2D stretch transform. Combined with `Transform2D.get_scale()`, this is
useful when using the `canvas_items` stretch mode in a project.

There are many situations where knowing this factor is useful:

- Divide Camera2D zoom to keep the size of the 2D game world identical
  regardless of the 2D scale factor (so that UI elements can still be scaled).
- Make certain controls always drawn at 1:1 scale
  (e.g. for the crosshair in a FPS). This is done by dividing the Control
  node's scale by the scale factor.
2024-11-19 23:11:13 +01:00
117158d271 Introduce a SubViewportContainer config for drag-and-drop targets
With the drag-and-drop rewrite, `SubViewportContainer` nodes were no
longer available as drop-locations.

This PR introduces a configuration option, that allows
`SubViewportContainer` to be considered as drop-location, but disables the
`Control` nodes inside its `SubViewport` children as drop-location.
2024-11-19 23:06:41 +01:00
932b2269f8 Fix missing native file dialog title translation. 2024-11-14 14:48:52 +02:00
925b690c98 Core: Integrate Ref::instantiate where possible 2024-11-10 12:41:26 -06:00
be349fa6d3 Fix tooltip appearing in old place, on movement
Fixes tooltip appearing in editor on old position of mouse.
Fixes tooltip appearing even if mouse is in steady motion (now accepts max 5 px movement).
2024-11-05 16:51:23 +02:00
16524a8a01 Add "Game" editor for better runtime debugging 2024-10-30 11:42:17 -03:00
6424b201e2 Don't override auto translate mode of custom tooltip 2024-10-25 16:13:45 +08:00
9aea7cbd15 Fix some flickering tooltips 2024-10-24 08:34:29 +08:00
Zae
3e30dd7954 Fix incorrect drag preview position under transformed CanvasLayer. 2024-10-10 03:08:04 +08:00
6f35915622 Allow Control to show custom tooltip when tooltip text is empty
Co-Authored-By: bruvzg <7645683+bruvzg@users.noreply.github.com>
2024-10-08 15:46:26 +08:00
78801f61da Add auto translate mode for tooltips 2024-09-26 22:31:22 +08:00
bdcee836ad Expose Viewport::get_audio_listener_2d and Viewport::get_audio_listener_3d to scripting
Document exposed methods

Apply suggestions from code review

Co-authored-by: Micky <66727710+Mickeon@users.noreply.github.com>

Document default behavior when no audio listeners are active
2024-09-19 18:43:33 -03:00
2a8d30aa9f Merge pull request #97029 from Hilderin/fix-viewport-texture-must-be-set-to-use-it
Fix Viewport Texture must be set to use it
2024-09-18 11:15:39 +02:00
c11107b1fb Fix Viewport Texture must be set to use it 2024-09-17 18:18:07 -04:00
ab55a40f0c Merge pull request #97070 from KoBeWi/snaming_ur_inputs
Use `SNAME` for `ui` actions in Viewport
2024-09-16 15:25:47 +02:00