Commit Graph

217 Commits (cb1569345a6f17da08241e645ab03cb2e1b78d2f)

Author SHA1 Message Date
A Thousand Ships 257d03681c
Use callable for `TreeItem` custom draw
Deprecating old functionality
2024-01-23 12:07:43 +07:00
Stanislav Labzyuk ff8797e980 Implement disabled state for Checkbox in Tree 2023-11-15 17:13:34 +07:00
Yuri Sizov 2924bfd4d3 Register theme properties with ThemeDB 2023-09-11 13:45:23 +07:00
Miguel Pereira 8278a5f274 Correctly display tooltips for buttons in Tree when they overlap cell content 2023-08-27 18:21:12 +07:00
Danil Alexeev 07d23489f4
GUI: Fix text overlapping icon in `Tree` 2023-08-24 22:09:02 +07:00
Danil Alexeev 5fb975e4a5
GUI: Fix `Tree` performance regression by using cache 2023-08-04 16:11:26 +07:00
Yuri Sizov b54d6cf466 Merge pull request #78393 from AThousandShips/tree_tooltip
Add ability to set the tooltip text of a `TreeItem` button
2023-07-12 15:09:09 +07:00
Yuri Sizov b4a11294e6 Merge pull request #75460 from joao-pedro-braz/add_new_item_stylebox_to_the_tree_control
Add a new "inner_item_margin" Theme constant to the Tree control
2023-07-12 15:08:36 +07:00
Ninni Pipping 75b355ee99 Add ability to set the tooltip text of a `TreeItem` button 2023-06-18 11:14:32 +07:00
Danil Alexeev 010829f962
Tree: Add ability to configure text autowrap mode for individual cells 2023-06-03 15:17:35 +07:00
João Pedro Braz 670b7bec9a Add the "inner_item_margin" Theme constant to the Tree control
This PR adds the "inner_item_margin" Theme constant to the Tree Control.
It behaves like a horizontal padding (in CSS), but only in the active
writing direction (So on LTR it'll apply a left padding and on RTL right
padding).

The Editor Theme has been updated to make use of this and a result items
in Trees and ItemLists no longer "hugs" their border, expressing a proper
spacing instead.
2023-06-02 11:32:40 +07:00
Yuri Sizov 3ed7bdc26f Implement `TreeItem.add_child` 2023-05-31 11:36:23 +07:00
Rémi Verschelde 4020cc8acb
Merge pull request #76794 from Wiwip/inline-edit
Inline editor for the file system dock
2023-05-11 11:46:45 +07:00
Hendrik Brucker dc46163b12 Improve editor state persistence 2023-05-11 04:17:03 +07:00
Wiwip b08a6084af Modifies the file system dock to use the inline editor instead of a dialog.
*Bugsquad edit:* Closes https://github.com/godotengine/godot-proposals/issues/4933
2023-05-10 18:49:35 +07:00
Danil Alexeev 865d6f5ed0
Fix multiline items drawing in `Tree` 2023-04-28 12:02:26 +07:00
Danil Alexeev 005937b576
Add support for multiline strings to `Tree` 2023-04-25 18:43:26 +07:00
needleful 9a968088db Add allow_search property to ItemList and Tree 2023-04-18 09:21:18 +07:00
Haoyu Qiu 498d538578 Add scrollbar offset theme constants to Tree 2023-04-06 15:04:28 +07:00
Rémi Verschelde 9c492204ca
Merge pull request #75340 from Barugon/tree_colunm_title_alignment
Implement column title alignment for `Tree`
2023-04-03 16:03:10 +07:00
Yuri Sizov 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 +07:00
Barugon c56ff437ae Implement column title alignment for `Tree` 2023-03-27 09:23:46 +07:00
Rémi Verschelde ce278b1b7a
Merge pull request #70433 from Sauermann/fix-treeitem-id
Fix confusion about TreeItem.add_button ambiguity between id and index
2023-01-16 09:15:15 +07:00
Rémi Verschelde 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 +07:00
Markus Sauermann 06f0184b63 Fix confusion about TreeItem.add_button ambiguity between id and index
A TreeItem button has an id and an index, which can be distinct.
This leads to confusion.

This PR documents the distinction between id and index.
2022-12-29 00:43:45 +07:00
Iceflower 908f392af6
Rename theme cache separation names 2022-11-30 16:06:14 +07:00
bruvzg 35528b800c
[Font] Add an import option to pre-render all glyphs required for the translation. 2022-11-10 10:43:15 +07:00
Ninni Pipping df9eaf5f47 Tree recursive folding 2022-09-21 13:28:29 +07:00
Yuri Sizov 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 +07:00
Yuri Sizov 3b1aa240dc Add a lifecycle method for manual theme item caching to Control 2022-09-01 16:35:36 +07:00
Micky 97f8c9b97c Rename TreeItem's `set_tooltip` to `set_tooltip_text`
`set_tooltip` -> `set_tooltip_text`
`get_tooltip` -> `get_tooltip_text`

For consistency:
`get_button_tooltip` -> `get_button_tooltip_text`
And the `tooltip` parameter in `add_button` was renamed to `tooltip_text`
2022-08-30 11:16:23 +07:00
kobewi f7f4873ed0 Replace Array return types with TypedArray 3 2022-08-24 12:53:36 +07:00
derammo 4e6c8e00fc fixed Tree UI control bug corrupting child cache 2022-08-04 08:24:51 +07:00
Rémi Verschelde 90019676b0 Code quality: Fix header guards consistency
Adds `header_guards.sh` bash script, used in CI to validate future
changes. Can be run locally to fix invalid header guards.
2022-07-25 11:17:40 +07:00
Ninni Pipping bed65894d3 Horizontal scroll for Tree 2022-07-07 12:58:44 +07:00
bruvzg 344ba0ffaf
Refactor Font configuration and import UI, and Font resources. 2022-07-06 14:12:36 +07:00
Nathan Franke 2d14164bca
tree: always emit item_edited 2022-05-26 05:12:57 +07:00
Rémi Verschelde 2998be4f99
Merge pull request #60061 from monkeyman192/allow_treeitem_visible
Allow TreeItem nodes to toggle visibility
2022-05-24 10:53:41 +07:00
trollodel 307427af89 Add the button pressed to some signals in Tree 2022-05-21 17:16:52 +07:00
monkeyman192 31381f8c9e Allow TreeItem nodes to toggle visibility 2022-05-16 23:55:05 +07:00
bruvzg be611c1c05
Implement Label3D node.
Add "generate_mipmap" font import option.
Add some missing features to the Sprite3D.
Move BiDi override code from Control to TextServer.
Add functions to access TextServer font cache textures.
Add MSDF related flags and shader to the standard material.
Change standard material cache to use HashMap instead of Vector.
2022-04-22 12:08:46 +07:00
reduz 6f401439f8 Implement Animation Libraries
* Instead of containing single animations, AnimationPlayer now contains libraries.
* Libraries, in turn, contain the animations.

This paves the way for implementing the possibility of importing scenes as animation libraries, finally allowing to import animations separate from the 3D models.

Missing (will be done on separate PRs):

* Make it possible to import scenes (dae/fbx/gltf) as animation libraries.
* Make it possible for AnimationTree to import animation libraries on its own, so it does not rely on AnimationPlayer for everything.
2022-04-11 12:51:54 +07:00
Rémi Verschelde f8ab79e68a Zero initialize all pointer class and struct members
This prevents the pitfall of UB when checking if they have been
assigned something valid by comparing to nullptr.
2022-04-04 19:49:50 +07:00
Pierre-Thomas Meisels 63f7f44ccb Make vararg method bind no return and return
Type emit_signal exposed method return type

set UndoRedo add_do_method and add_undo_method exposed return void

Set TreeItem::_call_recursive_bind returns void

Set _rpc_bind and _rpc_id_bind returns void in Node

Set _call_group and _call_group_flags method returns void in SceneTree

Set godot-cpp-test CI flag to false
2022-03-30 11:43:12 +07:00
Haoyu Qiu 374299c6fb Improve TreeItem button API 2022-02-08 23:56:13 +07:00
Stijn Hinlopen 31824420e4 Center when scrolling to tree item. 2022-02-05 10:59:33 +07:00
Rémi Verschelde 7072b359b4
Improve some method bindings to use specific `Object` subtypes
This was made possible by changes to `VariantCaster` which now make
it possible to pass any `Object`-derived type as pointer.
2022-01-28 15:07:22 +07:00
Rémi Verschelde e6caaf4c80
Merge pull request #57205 from TechnoPorg/variant-template-cast
Allow method binds to take Object subclasses as arguments
2022-01-27 23:46:37 +07:00
TechnoPorg 051ef479c9 Allow method binds to take Object subclasses as arguments
This commit adds a condition to VariantCaster that casts Variants of type OBJECT to any type T, if T is derived from Object.
This change enables a fair bit of code cleanup. First, the Variant implicit cast operators for Node and Control can be removed, which allows for some invalid includes to be removed. Second, helper methods in Tree whose sole purpose was to cast arguments to TreeItem * are no longer necessary.
A few small changes also had to be made to other files, due to the changes cascading down all the includes.
2022-01-25 09:03:36 +07:00
Kevin Fischer a4bac268c9 Addded methods to propagate checks & refactored classes to use new methods. 2022-01-18 19:21:59 +07:00
Rémi Verschelde fe52458154
Update copyright statements to 2022
Happy new year to the wonderful Godot community!
2022-01-03 21:27:34 +07:00
Nathan Franke 41a20171eb
align to horizontal_alignment, valign to vertical_alignment, related 2021-12-09 01:38:46 +07:00
Lightning_A e078f970db Rename `remove()` to `remove_at()` when removing by index 2021-11-23 18:58:57 +07:00
Aaron Franke 3c0fdcc8ac
Use "enum class" for input enums 2021-11-12 15:37:54 +07:00
Yuri Sizov bdbb7b3999 Remove EDSCALE dependency from /scene/gui 2021-10-04 15:25:08 +07:00
floppyhammer 53efc55409 Fix minimum size of TreeItem 2021-09-26 17:02:54 +07:00
Gilles Roudière ace19bd4c6 Cache TreeItem minimum size for performance. 2021-09-01 16:26:41 +07:00
bruvzg 4c3f7d1290 Makes FontData importable resource.
Adds multi-channel SDF font texture generation and rendering support.
Adds per-font oversampling support.
Adds FontData import plugins (for dynamic fonts, BMFonts and monospaced image fonts), font texture cache pre-generation and loading.
Adds BMFont binary format and outline support.
2021-08-27 15:43:18 +07:00
reduz 5cecdfa8af Entirely removes BIND_VMETHOD in favor of GDVIRTUAL
* `_gui_input`, `_input`, `_unhandled_input` and `_unhandled_key_input` are now regular C++ virutal functions.
* Everything else converted to GDVIRTUAL
* BIND_VMETHOD is gone, always use the new syntax from now on.

Creating `_gui_input` method and using the binder to register events will no longer work, simply override the virtual function now.
2021-08-23 08:10:13 +07:00
Kevin Fischer 75866c81e7 Added icons and API for indeterminate checkmarks for the Tree class. 2021-08-16 10:13:06 +07:00
Gilles Roudière ad8b5cd5a4 Implements TileMap layers and move TileSetPlugins's functions to the TileMap node instead 2021-08-02 13:54:39 +07:00
reduz f4379cbc82 Clean up Tree
Fixes some problems introduced by #49917

* Tree used minimum size as a stretch ratio, so it forced a minimum size of 1.
* Minimum size redone, stretch ratio moved to a separate setting
* Fitting to contents was enforced, this is more intuitive, but in many situations this is undesired.
* Added a clip content option for situations where fit to contents does not apply.
* Icon would scroll with the item, making it invislbe if the item is too long.
* Made icon always appear to the right (or left if RTL is enabled) of the visible item space.
2021-07-04 13:13:53 +07:00
Gilles Roudière d7d32ced5b Implement Tree's internal minimum width calculation 2021-06-28 15:54:31 +07:00
Gilles Roudière b2dddc3c82 Allow disabling scrolling in Tree 2021-06-25 21:19:46 +07:00
Lightning_A e28fd07b2b Rename `instance()`->`instantiate()` when it's a verb 2021-06-19 20:49:18 +07:00
Gregory Basile 8ab13f8ace Documentation search fixes
Updates rich_text_label so that the built-in documentation can be searched
Previously, it would only find the first result and would not select other results
Renames "_entered" functions to "_submitted"
2021-06-16 09:43:34 +07:00
reduz d95bc3fa67 Use bold fonts in editor
* Labels are now bold
* Categories in trees are bold
* Main editor buttons are bold
* Fixed section folding arrows in inspector
2021-06-02 12:47:57 +07:00
Yuri Sizov 9c92e9d849 Add highlight to the relationship lines of selected Tree items 2021-05-25 18:56:06 +07:00
trollodel bca0d36fe6 Improve TreeItem API and allow to move nodes 2021-05-17 22:06:46 +07:00
Rémi Verschelde 605e33cf39
Merge pull request #44831 from gongpha/dont-update-tree-if-selected
Blocking updating in SceneTreeEditor when an item was selected
2021-05-06 08:45:41 +07:00
Aaron Franke 0de9a7d803
Rename `doubleclick` to `double_click` 2021-05-04 04:38:08 +07:00
Juan Linietsky 97a3a66220 Improved 3D Scene Importer
* Added option for importers to show an Advanced settings dialog
* Created advanced settings dialog for Scene Importer
* Cleaned up importers (remove many old/unused options)
* Added the ability to customize every node, material, mesh and animation individually
* Saving to animations and meshes to files is now a manual process, making it more predictable
* Added the ability for materials to be replaced by external files (or to be made external, up to you).
* When doubleclicking an impoted scene in the filesystem dock, it automatically shows the import settings instead of asking to open it.

WARNING: Lightmap UV unwrap is not working, it needs to be re-made.
2021-03-22 12:16:40 +07:00
bruvzg d78336c65e
[CTL] Add missing font outline drawing routines and theme constants. 2021-02-14 14:11:44 +07:00
Rafał Mikrut 7961a1dea3 Initialize class variables with default values in scene/ [2/2] 2021-02-09 18:24:36 +07:00
Pedro J. Estébanez 177b804f30 Expose Tree::scroll_to_item() 2021-02-08 02:19:13 +07:00
Marcel Admiraal 8eb39f4e8b Change themes *_color_* to *_*_color
Changed:
font_color_accel -> font_accelerator_color
font_color_bg -> font_unselected_color
font_color_disabled -> font_disabled_color
font_color_fg -> font_selected_color
font_color_hover -> font_hover_color
font_color_hover_pressed -> font_hover_pressed_color
font_color_pressed -> font_pressed_color
font_color_readonly -> font_readonly_color
font_color_selected -> font_selected_color
font_color_shadow -> font_shadow_color
font_color_uneditable -> font_uneditable_color
icon_color_disabled -> icon_disabled_color
icon_color_hover -> icon_hover_color
icon_color_hover_pressed -> icon_hover_pressed_color
icon_color_normal -> icon_normal_color
icon_color_pressed -> icon_pressed_color

Also includes:
font_outline_modulate -> font_outline_color
tab_fg -> tab_selected
tab_bg -> tab_unselected
2021-01-24 06:28:49 +07:00
gongpha bb867d41ee Blocking updating in SceneTreeEditor when editing an item 2021-01-06 14:46:48 +07:00
Rémi Verschelde b5334d14f7
Update copyright statements to 2021
Happy new year to the wonderful Godot community!

2020 has been a tough year for most of us personally, but a good year for
Godot development nonetheless with a huge amount of work done towards Godot
4.0 and great improvements backported to the long-lived 3.2 branch.

We've had close to 400 contributors to engine code this year, authoring near
7,000 commit! (And that's only for the `master` branch and for the engine code,
there's a lot more when counting docs, demos and other first-party repos.)

Here's to a great year 2021 for all Godot users 🎆
2021-01-01 20:19:21 +07:00
Tomasz Chabora 2c048ea164 Cleanup unused engine code 2020-12-09 12:12:36 +07:00
bruvzg 99666de00f
[Complex Text Layouts] Refactor Font class, default themes and controls to use Text Server interface.
Implement interface mirroring.
Add TextLine and TextParagraph classes.
Handle UTF-16 input on macOS and Windows.
2020-11-26 14:25:48 +07:00
Aaron Franke 02161aad5a
Remove empty lines around braces with the formatting script 2020-11-16 23:38:11 +07:00
Marcel Admiraal 26fcf2b04c Add override keywords. 2020-07-10 13:56:54 +07:00
Haoyu Qiu 45d0799b5b Prevent dragging from SceneTree buttons 2020-07-02 15:27:59 +07:00
Juan Linietsky 058166fb6c Fix doubleclick on tree item, restore input focus on previous windows.
Closes #37335
2020-07-01 12:46:39 +07:00
Rémi Verschelde 0be6d925dc Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks
Which means that reduz' beloved style which we all became used to
will now be changed automatically to remove the first empty line.

This makes us lean closer to 1TBS (the one true brace style) instead
of hybridating it with some Allman-inspired spacing.

There's still the case of braces around single-statement blocks that
needs to be addressed (but clang-format can't help with that, but
clang-tidy may if we agree about it).

Part of #33027.
2020-05-14 16:54:55 +07:00
Rémi Verschelde 1a8167867b Modernize remaining uses of 0/NULL instead of nullptr (C++11)
Using clang-tidy's `modernize-use-nullptr`.
https://clang.llvm.org/extra/clang-tidy/checks/modernize-use-nullptr.html
2020-05-14 13:45:01 +07:00
lupoDharkael 95a1400a2a Replace NULL with nullptr 2020-04-02 13:38:00 +07:00
Juan Linietsky b3080bc2f4 Popups have also been converted to windows
Controls using the old modal API have been replaced to use popups.
2020-03-26 15:49:44 +07:00
Juan Linietsky 69c95f4b4c Reworked signal connection system, added support for Callable and Signal objects and made them default. 2020-02-20 08:24:50 +07:00
Juan Linietsky cf8c679a23 ObjectID converted to a structure, fixes many bugs where used incorrectly as 32 bits. 2020-02-12 14:24:54 +07:00
Juan Linietsky 3f335ce3d4 Texture refactor
-Texture renamed to Texture2D
-TextureLayered as base now inherits 2Darray, cubemap and cubemap array
-Removed all references to flags in textures (they will go in the shader)
-Texture3D gone for now (will come back later done properly)
-Create base rasterizer for RenderDevice, RasterizerRD
2020-02-11 11:53:26 +07:00
Haoyu Qiu 421ea09195 Fixes add group in Group Editor dialog
Before this fix, new group can't be created if any existing group starts
with the new name.
2020-02-02 11:11:20 +07:00
Rémi Verschelde a7f49ac9a1 Update copyright statements to 2020
Happy new year to the wonderful Godot community!

We're starting a new decade with a well-established, non-profit, free
and open source game engine, and tons of further improvements in the
pipeline from hundreds of contributors.

Godot will keep getting better, and we're looking forward to all the
games that the community will keep developing and releasing with it.
2020-01-01 11:16:22 +07:00
Rafał Mikrut 99d8626f4a Fix some overflows and unitialized variables 2019-11-20 16:22:16 +07:00
Rémi Verschelde ee611d149b
Merge pull request #22834 from lupoDharkael/recursive-item
Add call_recursive method to TreeItem
2019-10-04 15:32:14 +07:00
Nolan Darilek 5629a006d9 #14011: Implement `TreeItem.get_button_tooltip(column, idx)`.
When added to `TreeItem`, buttons are given tooltips. When returned via `get_button(...)`, however, the button is a `Texture` and the tooltip information isn't included.

For accessibility purposes, it is useful to have access to the tooltip text. As such, we can retrieve a button's tooltip to use as a button label.
2019-09-26 10:41:02 +07:00
Hugo Locurcio 40a5de97e6
Remove an unused icon and constant in Tree 2019-09-20 17:50:13 +07:00
lupoDharkael 306e64a9f5 Add call_recursive method to TreeItem 2019-09-04 12:42:08 +07:00
merumelu eac0af5892 Tree: fix and expose icon modulation 2019-08-24 17:37:22 +07:00
IAmActuallyCthulhu 82b9557803
Remove redundant author doc comments 2019-08-12 04:26:38 +07:00