Commit graph

151 commits

Author SHA1 Message Date
Rémi Verschelde
7e3afc3d09 Merge pull request #65213 from Mickeon/fix-label-visible-ratio 2022-09-01 23:49:28 +02:00
Micky
511134f55f Fix Label & RichTextLabel's visible_ratio not working 2022-09-01 19:22:12 +02:00
Yuri Sizov
3b1aa240dc Add a lifecycle method for manual theme item caching to Control 2022-09-01 16:35:36 +03:00
bruvzg
7aad14a4b6
[TextServer] Add support for trimming edge spaces on line break. 2022-09-01 08:11:55 +03:00
Micky
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
VolTer
832950d1f2 Reorganized Label and RichTextLabel properties 2022-08-28 10:26:04 +02:00
Micky
64bd36ecee Rename Label & RichTextLabel.percent_visible to visible_ratio
Also updates the documentation of both `visible_characters` and `visible_ratio` to, better describe what they do and improve consistency between the two Classes.
2022-08-26 12:15:57 +02:00
风青山
e561c68256 Add some codes, returnes directly if the value is not changed.
Avoid executing the following value-changed logics if the value does not really change.
2022-08-23 23:25:22 +08:00
Micky
9a63792a08 Clamp Label's percent_visible properly between 0 and 1.0
Also applies to RichTextLabel
2022-08-22 12:03:03 +02:00
Juan Linietsky
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
Rémi Verschelde
715f556cd4
Merge pull request #62139 from bruvzg/label_font_setttings
Add LabelSettings resource for quick Label theme property override.
2022-07-19 20:16:01 +02:00
bruvzg
cbe3a2dcb7
Use BitField hint for the TextServer enums. Add missing parts for BitField support to the GDextension API. 2022-07-15 08:49:50 +03:00
bruvzg
f63d54126d
Add LabelSettings resource for quick Label theme property override. 2022-07-12 16:05:12 +03:00
bruvzg
344ba0ffaf
Refactor Font configuration and import UI, and Font resources. 2022-07-06 14:12:36 +03:00
bruvzg
b5c96df277
Move duplicate AutoWrap, Overrun and VisibleChar behavior enums to the TextServer. 2022-06-16 16:49:37 +03: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 +03:00
bruvzg
f19cd44346
Unify TextServer built-in module and GDExtension code. 2022-03-17 08:15:29 +02:00
Rémi Verschelde
0f5455230c
Use switch consistently in _notification (scene folder) 2022-02-15 18:44:55 +01:00
bruvzg
2e01a0d7a3
[RTL / Label] Reorganize property order to ensure "visible_characters" / "percent_visible" are set after the "text". 2022-02-11 12:31:13 +02:00
bruvzg
215bede6ff
[TextServer] Add function to change font, font size, and OpenType features without invalidating line break points, justification points, or recreating shaped text buffer. 2022-02-02 11:20:44 +02:00
bruvzg
40c56ed410
Improve locale detection.
Use separate language, script and country lists.
Add locale selection dialog and property hint.
2022-01-18 14:30:00 +02:00
bruvzg
e02a097280
[TextServer] Implement locale and context sensitive case conversion functions. 2022-01-17 14:23:36 +02:00
bruvzg
baec983d8a
[TextServer] Improvements for line breaking, "Fill" alignment, overrun, and interaction between these modes.
Fix "Fill" alignment processing wrong side of the text if overrun trim was applied.
Improve "Fill" alignment to avoid adding excessive subsequent spaces or elongations.
Add font detection to the overrun, to correctly add ellipsis (was using last glyph font, which doesn't necessary have dot character).
Improve line breaking to avoid adding excessive subsequent soft break points for languages without word separator.
Port missing overrun/justification code to the Fallback text server.
Fix inferred text direction detection by controls.
Add tests for "Fill" alignment and line breaking glyph flags.
2022-01-13 08:53:28 +02:00
bruvzg
c89c515ccf
[TextServer] Improve ligature cursor handling.
Fix mid-grapheme hit test.
Fix OpenType features property handling, add default features override option.
Enable mid-grapheme cursor by default.
2022-01-09 19:03:48 +02:00
Rémi Verschelde
fe52458154
Update copyright statements to 2022
Happy new year to the wonderful Godot community!
2022-01-03 21:27:34 +01:00
Rémi Verschelde
1906b59675
Merge pull request #55636 from bruvzg/vis_char_modes
Add different "visible characters" behavior modes.
2021-12-23 00:43:33 +01:00
Nathan Franke
49403cbfa0
Replace String comparisons with "", String() to is_empty()
Also:
- Adds two stress tests to test_string.h
- Changes to .empty() on std::strings
2021-12-09 04:48:38 -06:00
Nathan Franke
41a20171eb
align to horizontal_alignment, valign to vertical_alignment, related 2021-12-09 01:38:46 -06:00
kobewi
ea7cc1dea9 Rename minimum_size_changed() method 2021-12-06 14:02:34 +01:00
bruvzg
ad4408d413
Add different "visible characters" behavior modes. 2021-12-06 12:14:49 +02:00
bruvzg
5f9cd9ccbc Fix Label and RichTextLabale text shadows and shadow outlines. 2021-11-06 10:22:09 +02:00
bruvzg
0c0b5c84b0 Implement TextServer GDExtension interface, remove TextServer GDNative interface. 2021-10-01 15:13:29 +03:00
bruvzg
99dc2ec9e1 Fix RTL layout Label text, VBox child, 3D node editor controls, and popup menu alignment. 2021-09-21 10:35:23 +03:00
bruvzg
9d0e3cff09 Fix Label and RichTextLabel visible_characters and percent_visible methods. 2021-09-20 09:35:24 +03:00
Rémi Verschelde
c7455d9d42
Merge pull request #52012 from bruvzg/fix_label_outline 2021-09-13 14:23:52 +02: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 +03:00
bruvzg
54345f11fb Fix label outline overlaps. 2021-08-23 14:13:13 +03:00
Hendrik Brucker
403f4902d0 Various text layout improvements (TextLine, TextParagraph, Label, TextServer) 2021-08-11 00:09:48 +02:00
Michael Alexsander
94a64d557e Add auto_translate toggle for automatic translation 2021-07-29 18:30:34 -03:00
reduz
6631f66c2a Optimize StringName usage
* Added a new macro SNAME() that constructs and caches a local stringname.
* Subsequent usages use the cached version.
* Since these use a global static variable, a second refcounter of static usages need to be kept for cleanup time.
* Replaced all theme usages by this new macro.
* Replace all signal emission usages by this new macro.
* Replace all call_deferred usages by this new macro.

This is part of ongoing work to optimize GUI and the editor.
2021-07-18 21:20:02 -03:00
Hendrik Brucker
56a8d3f30c Improvements to Label's layout options
- Added options to trim the text in case it overruns
- Added more autowrap modes
- Improved line breaking, which ignores trailing spaces
2021-07-04 16:43:55 +02:00
Haoyu Qiu
a57a51750a Update min size on Label::set_text 2021-06-21 19:54:40 +08:00
Rémi Verschelde
1129439f09
Merge pull request #49011 from KoBeWi/totally_h
Fix valign with stylebox borders
2021-06-15 16:25:49 +02:00
Hugo Locurcio
87f503310b
Tweak dozens of editor property hints for consistency
- Update Viewport MSAA property hints to match the currently
  exposed values.
- Add some performance hints to property hints.
2021-05-25 02:50:35 +02:00
kobewi
47108202c6 Fix valign with stylebox borders 2021-05-23 22:39:38 +02:00
jmb462
3bd44f3cb6 fix Label visible_characters bad precision 2021-03-07 23:18:16 +01:00
kleonc
d7bb7cad47 Label::set_lines_skipped Fail if passed a negative value 2021-02-21 14:23:57 +01:00
Michael Alexsander
85dc55a82c Keep Label's min height when empty 2021-02-12 21:13:49 -03:00
reduz
1aa2823fa3 Removed _change_notify
-For inspector refresh, the inspector now detects if a property change by polling a few times per second and then does update the control if so. This process is very cheap.
-For property list refresh, a new signal (property_list_changed) was added to Object. _change_notify() is replaced by notify_property_list_changed()
-Changed all objects using the old method to the signal, or just deleted the calls to _change_notify(<property>) since they are unnecesary now.
2021-02-10 19:31:24 -03:00
Rafał Mikrut
7961a1dea3 Initialize class variables with default values in scene/ [2/2] 2021-02-09 18:24:36 +01:00