Commit Graph

109 Commits

Author SHA1 Message Date
8d911b2554 [Window] Expose start_drag and start_resize methods (for both native and embedded windows). 2025-01-07 23:35:14 +02:00
7b42fb969e Merge pull request #100685 from raulsntos/dotnet/collection-expressions
[.NET] Use collection expressions in docs
2024-12-23 11:15:15 -06:00
072ff85f82 [.NET] Use collection expressions in docs
As of C# 12 we can now use collection expressions to reduce some boilerplate when initializing collections.
2024-12-21 02:28:59 +01:00
9604e98a52 [MenuBar] Use PopupMenu title property as a menu name. 2024-12-20 23:35:07 +02:00
9fece033ab [macOS, Windows] Add support for excluding windows from a screenshot. 2024-12-10 11:00:13 +02:00
1745fe15a4 Merge pull request #99837 from thiagola92/docs_window_files_dropped
Docs: update example from Window signal files_dropped
2024-11-29 22:51:38 +01:00
e30da67ce9 Docs: update example from Window signal files_dropped 2024-11-29 11:38:04 -03:00
88e81ee730 Fix various typos and code style issues 2024-11-28 17:40: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
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
2c31bd767c Merge pull request #99020 from Mickeon/documentation-example-pruning-2
Clean up more `[b]Example:[/b]` lines from the class reference
2024-11-12 09:28:02 -06:00
932b1c434c Clean up more [b]Example:[/b] lines from the class reference 2024-11-11 12:05:34 +01:00
7dbea98c49 Merge pull request #97005 from Repiteo/core/window-corner-style
Core: Add `DisplayServer` flag for sharp corners
2024-10-21 16:39:25 -05:00
f8c4a683d7 Core: Add DisplayServer flag for sharp corners 2024-10-18 11:20:21 -05:00
009446a277 Add System Locale layout direction for Control and Window 2024-10-17 07:52:07 +08:00
2ed679eb87 Document expected coordinates in PopupMenu.popup()
- Improve documentation related to embedded subwindows and single-window mode.
- Add `minsize` keyword aliases for `popup_centered_clamped()` methods
  to ease migration to Godot 4.x (this was Godot 3.x terminology).
2024-08-05 16:45:33 +02:00
64d789aba7 Fix get_position_with_decorations and get_size_with_decorations for embedded windows. 2024-05-24 20:10:36 +03:00
cfdb968848 [Window] Allow to override viewport and project settings and force use of native window. 2024-03-04 23:06:27 +02:00
c9b531c613 Merge pull request #88920 from AThousandShips/group_doc_fix
[Doc] Fix some incorrect uses of "children"
2024-02-29 13:54:18 +01:00
9b5cd8e240 [Doc] Fix some incorrect uses of "children" 2024-02-29 11:52:55 +01:00
3fe01226b7 Use black for font outlines by default instead of white
This makes font outlines more usable out of the box, as black
is one of the most commonly used colors for font outlines.
2024-02-28 20:25:15 +01:00
5ba92e5a57 Fix some DEFVALs to use the right type
- Use `StringName()` in DEFVAL for StringNames.
- Use `Variant()` in DEFVAL for Variants.
2024-02-23 01:50:18 +01:00
f9a758772a Update many Deprecated/Experimental descriptions for consistency 2024-02-17 21:33:12 +01:00
7b42c24550 Make auto translation inheritable 2024-02-15 16:51:19 -03:00
af28f87791 Documentation: Add support for deprecated/experimental messages 2024-02-15 15:59:50 +03:00
0d88aadd53 Automatically set viewport background to transparent when window flag is set. 2024-02-02 10:40:26 +02:00
03767fbf3b Merge pull request #86446 from reduz/transient-to-focused
Implement a `transient_to_focused` Window mode
2024-01-15 13:25:00 +01:00
15144c24bd Implement a transient_to_focused mode
This intends to be the correct way to handle non-child windows becoming covered by the current window when becoming focused.
Enabling this property on select windows, they will become transient to the currently focused one when becoming visible.

This deprecates the "unparent_when_invisible" function introduced by #76025.
2024-01-14 18:51:44 +01:00
06534f8ad5 Add deprecation notice to a duplicate method of class Window 2024-01-12 18:18:28 +01:00
0358abbeba Merge pull request #82179 from bruvzg/mode_docs
[Docs] Update and sync Window and DisplayServer window mode descriptions.
2023-10-03 17:22:05 +02:00
72e2e47059 [DisplayServer] Add method to estimate window title bar size. 2023-10-03 16:13:52 +03:00
c8df5e7291 [Docs] Update and sync Window and DisplayServer window mode descriptions. 2023-10-02 23:47:32 +03:00
9819ffb166 Implement window center function. 2023-08-26 21:34:21 +03:00
33198d0df0 Merge pull request #75784 from Riteo/int-scale
Add content scale stretch modes, implement integer scaling
2023-08-11 10:32:11 +02:00
87cfc415a3 Add content scale stretch modes, implement integer scaling
Integer scaling is achieved (after aspect expansion) by "lying" to the
stretching code about the window's size, telling it that it's always an
integer multiple of the viewport so that it only gets stretched to an
integer factor.

This approach works with all stretch and aspect modes and doesn't
require handling for each, only requiring to "loosen up" some
self-excluding conditions (in other words, replacing some `else if`s
with just `if`s) regarding viewport offset and margin calculation (black
bars).

Includes a tiny usability change that adds a range hint for the content
scale factor between 0.5 to 8.0.

Co-Authored-By: Hugo Locurcio <hugo.locurcio@hugo.pro>
2023-08-10 19:45:47 +02:00
f270163ab0 Expose Window's _get_contents_minimum_size() to scripting 2023-08-02 14:40:38 -03:00
2a9aaae8a5 Merge pull request #79293 from ItsNL/add-accept-dialog-close-on-unfocused
Check `FLAG_POPUP` to close an AcceptDialog when parent is focused
2023-08-02 12:17:06 +02:00
1c3c17c608 Refactor mouse_entered and mouse_exited notifications
The previous implementation for signals mouse_entered and mouse_exited
had shortcomings that relate to focused windows and pressed mouse buttons.
For example a Control can be hovered by mouse, even if it is occluded by
an embedded window.

This patch changes the behavior, so that Control and Viewport send
their mouse-enter/exit-notifications based solely on mouse position,
visible area, and input restrictions and not on which window has
focus or which mouse buttons are pressed. This implicitly also
changes when the mouse_entered and mouse_exited signals are sent.

This functionality can not be implemented as a part of
Viewport::_gui_input_event, because of its interplay with Windows and
because Viewport::_gui_input_event is based on input and not on
visibility.
2023-08-01 13:28:49 +02:00
NL
a77d8b3eb5 Check FLAG_POPUP to close an AcceptDialog when parent is focused 2023-07-19 16:06:02 +02:00
576980f960 Add a default theme for unfocused Windows
At the moment it is impossible to distinguish between focused and
unfocused embedded Windows.
Add a new `theme_item` that is used for coloring the border of
unfocused Windows.
2023-07-12 22:35:03 +02:00
81064cc239 Doctool: Remove version attribute from XML header
We don't use that info for anything, and it generates unnecessary diffs
every time we bump the minor version (and CI failures if we forget to
sync some files from opt-in modules (mono, text_server_fb).
2023-07-06 10:08:21 +02:00
346f1ab86b Bump version to 4.2-dev
Keep on waitin'
2023-07-05 22:07:03 +02:00
a1f517b77d Fix documentation of popup_centered_ratio 2023-06-23 22:35:25 +02:00
989dedddf9 Merge pull request #77577 from YeldhamDev/improve_window_docs
Improve `Window` documentation
2023-05-29 17:34:24 +02:00
f7fced5e00 Improve Window documentation 2023-05-29 11:18:31 -03:00
151a4ba6a5 Overhaul the top sections of the class reference (GUI classes) 2023-05-28 14:24:54 +02:00
49890a99c1 Expose get_window_id() from Window class
Window classes often need a Window ID for operations. This will help with performing operations on cached Windows.
2023-05-20 14:48:24 -07:00
17f492fb82 Expose dialog parent-and-popup logic to the API 2023-05-15 19:49:28 +02:00
921d231ad6 Merge pull request #76664 from Xenoparrot/simple-typos 2023-05-06 15:41:55 +02:00
33b9be27d3 Some clarifications on screen-space coordinates 2023-05-03 20:15:49 +02:00