Commit Graph

165 Commits

Author SHA1 Message Date
1a72f4c3ba Add scrollbar_h/v_separation theme properties to ScrollContainer 2025-10-24 01:16:51 -07:00
e9a5208c8b Fix incorrect margins in ScrollContainer with focus border enabled 2025-10-07 20:49:33 -03:00
aeb3a45c97 Hide Control focus when given via mouse input 2025-09-19 13:43:29 -03:00
3f757c41fc Update access-kit to 0.17.0 2025-07-29 08:37:01 +03:00
df70765af0 Fix SCROLL_MODE_RESERVE with RTL layout 2025-05-28 23:24:27 +02:00
d32d2e9b51 Remove NOTIFICATION_ENTER_TREE when NOTIFICATION_THEME_CHANGED is used 2025-05-06 15:28:03 +02:00
f8f350a32a Add GLOBAL_GET cached macros.
GLOBAL_GET is an expensive operation which should not be used each frame / tick.
This PR adds macros which do a cheaper revision check, and only call the expensive GLOBAL_GET when project settings have changed.

Co-authored-by: Lukas Tenbrink <lukas.tenbrink@gmail.com>
2025-04-30 15:08:50 +01:00
fd1eeacf23 [ScrollContainer] Fix focus rect draw position in RTL layout. 2025-04-28 11:26:01 +03:00
b6b3b0e0d6 Unify ScrollBar/ScrollContainer scroll delta 2025-04-23 21:15:44 +02:00
039d9ffd30 Merge pull request #104317 from pafuent/fixing_wrong_focus_style_clipping_on_scroll_container
Fix `ScrollContainer` focus border issue
2025-04-15 12:28:50 -05:00
e1384dd159 Fix ScrollContainer focus border issue
Fixes #100176

Instead of using no clipping technique to draw the focus border because
it causes problems if a `ScrollContainer` is nested in another
`ScrollContainer`, now the focus border is drawn using an internal
`PanelContainer`.
2025-04-14 17:51:43 -03:00
292119dd68 Fix smooth scrolling tied to physics process 2025-04-11 17:14:25 -04:00
b106dfd4f9 Base accessibility API. 2025-04-08 20:14:28 +03:00
3c85281610 Scroll inspector while drag hovering near the edge 2025-03-26 12:37:12 -04:00
69c5b03070 Merge pull request #101625 from Rindbee/fix-follow-focus-in-rotated-ScrollContainer
Fix Follow Focus in a rotated `ScrollContainer`
2025-01-27 09:46:14 -06:00
815e905972 Typo fix: rename SortableVisbilityMode 2025-01-19 00:33:39 +01:00
b75acc3ccd Fix Follow Focus in a rotated ScrollContainer
Calculate based on the `ScrollContainer`'s space to eliminate possible
rotation. The global rect already has applied the rotation, so it
should not be used.
2025-01-16 14:58:43 +08:00
86ea0127a3 Add a focus border on ScrollContainer
Also added new unit tests for `Control`.

Co-authored-by: ator-dev <dominic.codedeveloper@gmail.com>
2024-11-23 23:54:38 -03:00
0d350e7108 Set clang-format RemoveSemicolon rule to true
- Set clang-format `Standard` rule to `c++20`
2024-10-25 13:49:43 -04:00
59c66585d5 Fix ScrollContainer configuration warnings 2024-09-21 19:53:02 +02:00
b36bebc6da Add SCROLL_MODE_RESERVE to ScrollContainer 2024-09-12 14:02:01 +02:00
6d516a2609 Fix scroll container min size calculation 2024-09-10 17:25:34 +03:00
7e549aa52e Fix rtl on follow focus
Change right_margin to side_margin
2024-07-23 10:29:55 +02:00
fbb879debd [Scene] Add SceneStringNames::text/value_changed 2024-06-19 09:44:38 +02:00
02e1e6d1ec Add visibilty mode to as_sortable_control() 2024-06-03 20:01:31 +02:00
9353081338 Fix scrollbar issues in ScrollContainer 2024-05-19 22:20:43 -03:00
5c28814b39 Add as_sortable_control() to unify Container checks 2024-05-08 11:45:52 +02:00
30356a488f Enabled 'Scrolling' signal when scrolling with middle mouse on RichTextLabel/ScrollContainer 2024-04-22 20:44:03 +01:00
79ba22a73f Use Vector* component-wise min/max/clamp functions where applicable 2024-03-20 13:47:42 +01:00
21f0529aa9 Revert "Update Node::get_configuration_warnings signature"
This reverts commit d3852deaa4.
2024-02-17 19:03:21 +01:00
d3852deaa4 Update Node::get_configuration_warnings signature 2024-02-08 23:05:20 +01:00
0e8f90f4c8 Update deferred calls to use Callables 2024-01-09 16:11:47 +01:00
a29416e332 [Scene,Main] Replace ERR_FAIL_COND with ERR_FAIL_NULL where applicable 2023-09-12 12:53:06 +02:00
2924bfd4d3 Register theme properties with ThemeDB 2023-09-11 13:45:23 +02:00
29358daa4d Expose horizontal/vertical custom_step as editor property for the ScrollContainer 2023-04-29 23:56:59 +02:00
47592927b3 Use BitField<> hint for ArrayFormat
This was missing in the conversion of bitflags to BitField<>.
2023-01-08 18:47:48 +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
e18107a57c Fix Determining Window for Touchscreen
DisplayServer::screen_is_touchscreen will likely never utilize its
parameter p_screen.
This PR replaces this function by DisplayServer::is_touchscreen_available()
with the same functionality.
This solves the problem, that a SubViewport was used for determining
the screen, which resulted in error messages.
2022-12-07 09:54:29 +01:00
18978881fe Code simplifications
CanvasItemEditor:
- p_result == ADD_MOVE is always true in this switch-clause

- both parts of the if-else-clause do the same thing and simplified an affine_inverse call

ControlEditorToolbar:
- private function ControlEditorToolbar::_anchor_to_position is used nowhere. Looks like
copy and paste from CanvasItemEditor::_anchor_to_position

ScrollContainer:
- screen_is_touchscreen is always true, because otherwise the function already returned

TextLine:
- both parts of the if-else-clause do the same thing and simplified return statement
2022-11-07 01:21:25 +01:00
42073fc2bb Use more reasonable scrollable conditions in ScrollContainer
The visibility of the `ScrollBar` was used as a condition for judging whether it should scroll.
**Visible** and **scrollable** are currently not the same in some cases (`SCROLL_MODE_SHOW_NEVER`).
This makes `SCROLL_MODE_SHOW_NEVER` not working properly.

This patch will make `SCROLL_MODE_SHOW_NEVER` available, so that the external `SrollBar` can
share the internal `ScrollBar`'s data, we can achieve the purpose of replacing the internal
`ScrollBar` with a custom external one.
2022-10-18 16:32:39 +08:00
Zae
186ca020b3 Fix ScrollContainer touch-scrolling not working. 2022-09-29 01:47:03 +08:00
aed3822a93 Change return type of get_configuration_warnings to PackedStringArray 2022-09-19 16:43:15 +01:00
43f03e2ce6 Improve naming of theme properties throughout GUI code
Rename ItemList's bg -> panel
Rename ItemList's bg_focus -> focus
Rename ProgressBar's bg -> background
Rename ProgressBar's fg -> fill
Rename Tree's bg -> panel
Rename Tree's bg_focus -> focus
Rename ScrollContainer's bg -> panel
Rename FileDialog's *_icon_modulate -> *_icon_color
Rename FileDialog's files_disabled -> file_disabled_color
Rename CheckButton's on/off -> checked/unchecked
Rename check_v_adjust -> check_v_offset
2022-09-06 22:53:17 +03:00
3b1aa240dc Add a lifecycle method for manual theme item caching to Control 2022-09-01 16:35:36 +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
fd6453c45e Revert "Remove NOTIFICATION_ENTER_TREE when paired with NOTIFICATION_THEME_CHANGED"
This reverts commit 4b817a565c.

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-29 11:11:29 +02:00
4b817a565c Remove NOTIFICATION_ENTER_TREE when paired with NOTIFICATION_THEME_CHANGED 2022-08-27 11:52:29 -06:00
a7eecc61ad Fix toggling after scrolling resulted in blank space
Previously, the data used by `update_scrollbars()` and `_update_dimensions()` in their calculations depended on each other, which caused some problems.

Now, the calculation of `child_max_size` is put into `get_minimum_size()`, as the containers call `update_minimum_size()` before calling `queue_sort()`.

Make the semantics of variable/function names more clear.

Co-authored-by:  Aaron Record <aaronjrecord@gmail.com>
2022-07-31 09:32:20 +08:00
0c81502217 Merge pull request #62093 from Rindbee/fix-undecided-min_size-in-ScrollContainer 2022-07-22 23:47:48 +02:00
b3bd082070 Merge pull request #63295 from winterpixelgames/master-allow-scroll-container-scroll-to-be-set-instantly 2022-07-22 00:51:43 +02:00