Commit Graph

114 Commits

Author SHA1 Message Date
e5373c5cb0 Validate theme type name input in Add Theme Type dialog 2025-08-28 15:47:37 +08:00
e6c9a832c1 Editor: Add ability to rename theme types 2025-05-29 21:57:48 +03:00
466590d0ec Use get_slicec instead of get_slice for single character splitters 2025-03-08 20:36:37 +01:00
94a7dfeae1 Add additional methods for has_theme_item to check for font and font size 2025-01-07 16:56:14 +00:00
c1cdcad96a Fix ProjectTag button variation 2025-01-03 11:41:00 +01: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
b5c31ebb41 Add contains_char() for single-character 'contains' calls. 2024-12-06 20:23:35 +01:00
7593e55527 Improve Editor Inspector/Theme item lookup performance
Changes to reduce the latency between changing node selection in the editor and seeing the new node reflected in the Inspector tab

- Use Vector instead of List for ThemeOwner::get_theme_type_dependencies and related functions
- Use Vector instead of List for ThemeContext::themes, set_themes(), and get_themes()
- Add ClassDB:get_inheritance_chain_nocheck to get all parent/ancestor classes at once, to avoid repeated ClassDB locking overhead
- Update BIND_THEME_ITEM macros and ThemeDB::update_class_instance_items to use provided StringNames for call to ThemeItemSetter, instead of creating a new StringName in each call

These changes reduce the time taken by EditorInspector::update_tree by around 30-35%
2024-08-20 13:39:40 -04:00
1d3f98ac6a Merge pull request #86894 from jsjtxietian/merge-dafault-font
In `merge_with` also merge some default fields of theme
2024-01-09 11:29:52 +01:00
6f3568e3db In merge_with also merge some default fileds of theme 2024-01-08 10:41:30 +08:00
96a95cb974 Add const lvalue ref to container parameters 2024-01-05 14:49:57 -03:00
b3970336ce Added variations to get_type_list() 2023-10-30 10:27:38 -05:00
58126e479c Introduce the concept of global theme contexts
This commit adds the default theme context, which replaces
the need to manually check the project and the default theme
all the time; simplifies related code.

It also adds framework for custom theme contexts, to be used
by the editor. Custom contexts can be attached to any node,
and not necessarily a GUI/Window node. Contexts do no break
theme inheritance and only define which global themes a node
uses as a fallback.

Contexts propagate NOTIFICATION_THEME_CHANGED when one of their
global themes changes. This ensures that global themes act just
like themes assigned to individual nodes and can be previewed
live in the editor.
2023-09-06 19:40:43 +02:00
de4a3fa151 Unify and streamline connecting to Resource changes 2023-07-17 19:35:57 +02: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
0103af1ddd Fix MSVC warnings, rename shadowed variables, fix uninitialized values, change warnings=all to use /W4. 2022-10-07 11:32:33 +03:00
6320a0fc18 Add ThemeDB, expose previously static Theme methods 2022-08-26 19:23:05 +03:00
d4433ae6d3 Remove Signal connect binds
Remove the optional argument p_binds from `Object::connect` since it was deprecated by Callable.bind().
Changed all uses of it to Callable.bind()
2022-07-29 16:26:13 +02:00
4678736a39 Add suffixes to all nodes and resources 2022-06-11 09:41:05 -05:00
45af29da80 Add a new HashSet template
* Intended to replace RBSet in most cases.
* Optimized for iteration speed
2022-05-20 22:40:38 +02:00
900c676b02 Use range iterators for RBSet in most cases 2022-05-19 12:09:16 +02:00
21b253a870 Define some Theme data structures with using for readability 2022-05-18 18:17:47 +03:00
4e0f11cfdb Restore Theme.get_type_list behavior to properly handle uniqueness 2022-05-18 15:41:44 +03:00
0497b67bec Merge pull request #60130 from fire-forge/theme-node-names 2022-05-16 14:57:21 +02:00
8b7c7f5a75 Add a new HashMap implementation
Adds a new, cleaned up, HashMap implementation.

* Uses Robin Hood Hashing (https://en.wikipedia.org/wiki/Hash_table#Robin_Hood_hashing).
* Keeps elements in a double linked list for simpler, ordered, iteration.
* Allows keeping iterators for later use in removal (Unlike Map<>, it does not do much
  for performance vs keeping the key, but helps replace old code).
* Uses a more modern C++ iterator API, deprecates the old one.
* Supports custom allocator (in case there is a wish to use a paged one).

This class aims to unify all the associative template usage and replace it by this one:
* Map<> (whereas key order does not matter, which is 99% of cases)
* HashMap<>
* OrderedHashMap<>
* OAHashMap<>
2022-05-12 11:21:29 +02:00
d8c04cda3a Validate theme type/item names 2022-04-26 19:54:43 +08:00
197be78bc5 Fix Theme type group naming in the inspector 2022-04-10 22:18:21 -05:00
7a7fabe4f6 Merge pull request #57641 from Geometror/compilation-time-improvements-1 2022-02-12 09:46:02 +01:00
b396fd4eef Improve compilation speed (forward declarations/includes cleanup) 2022-02-12 02:46:22 +01:00
175088db25 Add an explicit way to remove a theme type 2022-02-11 17:57:52 +03:00
adbe948bda String: Add contains(). 2022-02-04 01:28:02 +05:45
a2a4ec7cb5 Merge pull request #56376 from pycbouh/theme-tombe-les-theme-properties 2022-01-06 11:33:43 +01:00
fe52458154 Update copyright statements to 2022
Happy new year to the wonderful Godot community!
2022-01-03 21:27:34 +01:00
fe283fd07a Correctly use fallback Theme values as last resort 2021-12-31 18:53:43 +03:00
ebbc25e89c Ignore empty Font resources as theme override.
Add range hint to font_size properties.
Remove excessive `base_size` Font property.
2021-10-25 14:05:37 +03:00
0855e5f8f7 Correctly bind optional arguments when emitting Theme changes 2021-10-04 22:22:41 +03:00
4e12f770cf Make Theme report property list changes less often 2021-10-04 17:27:00 +03:00
4a42a66cd9 Add the base scale factor to the Theme resource 2021-10-04 15:25:07 +03:00
8aa78bc050 Reorganize Theme resource code for better maintainability 2021-10-02 19:26:20 +03:00
855cfe1559 Add support for partial custom editor themes 2021-08-14 02:03:07 +03:00
ac3322b0af Use const references where possible for List range iterators 2021-07-25 12:22:25 +02:00
4e6efd1b07 Use C++ iterators for Lists in many situations 2021-07-23 17:38:28 -04:00
4ee0e6ddf5 Add type variations to Theme 2021-07-13 02:26:28 +03:00
12e0f10c74 Merge pull request #49227 from pycbouh/editor-theme-freeze-changes
Prevent `Theme` resource from emitting changes during bulk operations
2021-06-13 15:44:32 +02:00
9e328bb5b7 Core: Move DirAccess and FileAccess to core/io
File handling APIs are typically considered part of I/O, and we did have most
`FileAccess` implementations in `core/io` already.
2021-06-11 14:52:39 +02:00
790d6e602b Fix Theme overriding existing theme types with empty 2021-06-04 16:34:49 +03:00
9cd96ebe0e Prevent Theme resource from emitting changes during bulk operations 2021-05-31 17:40:45 +03:00
9eaa139c1f Add theme_custom_type property to Control and Window 2021-05-17 17:20:42 +03:00
2524238bb3 Refactor Edit Theme menu in Theme Editor 2021-04-18 17:55:49 +03:00
b2eb838781 doc: Sync classref with current source 2021-03-29 09:51:33 +02:00