summaryrefslogtreecommitdiff
path: root/scene/gui/button.cpp
AgeCommit message (Collapse)Author
2023-01-09Removed unused property hints and `Object::get_translatable_strings()`Juan Linietsky
* Remove unused `EditorPropertyMember` and related hints, previouly used by VisualScript. Such logic should be implemented in the VS module itself. * As the above broke compatibility with the VS module, clean up the other hacks that were still in core in support of VisualScript. * `PROPERTY_USAGE_INTERNATIONALIZED` was only used in Object's `get_translatable_strings()`, which is a legacy function not used anywhere. So both are removed. * Reordered some usage flags after the above removal to minimize the diff. * General clean up. Fixes #30203. Co-authored-by: Rémi Verschelde <rverschelde@gmail.com>
2023-01-05One Copyright Update to rule them allRémi Verschelde
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".
2022-11-14Remove redundant Variant-types initializationsMarkus Sauermann
2022-09-01Add a lifecycle method for manual theme item caching to ControlYuri Sizov
2022-09-01[TextServer] Add support for trimming edge spaces on line break.bruvzg
2022-08-29Rename `CanvasItem.update()` to `queue_redraw()`Micky
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-12Fix case where `h_separation` might not work in `Button`Rindbee
This patch mainly solves two things: 1. The typo of `h_separation`; 2. Negative values of `h_separation` will be treated as `0` when used, to prevent the button's minimum `width` from being reduced by `h_separation`.
2022-08-05Round icon position and size in buttons to make them look sharperYuri Sizov
2022-08-02Add fit_to_longest_item to OptionButtonkobewi
2022-07-15Use BitField hint for the TextServer enums. Add missing parts for BitField ↵bruvzg
support to the GDextension API.
2022-07-08Fix regressions from Font refactorbruvzg
Remove unnecessary font override Fixes button outline draw when it should not, causing button colors to be slightly off
2022-07-06Refactor Font configuration and import UI, and Font resources.bruvzg
2022-06-16Move duplicate AutoWrap, Overrun and VisibleChar behavior enums to the ↵bruvzg
TextServer.
2022-06-08Add overrun behavior to the Button.bruvzg
2022-05-17Merge pull request #60867 from KoBeWi/μtextRémi Verschelde
Remove font height restriction from Button
2022-05-10Fix button icon expansion calculation with empty textHendrik Brucker
2022-05-08Remove font height restriction from Buttonkobewi
2022-04-23Rename theme properties to include underscoresFireForge
- check_vadjust -> check_v_adjust - close_h_ofs -> close_h_offset - close_v_ofs -> close_v_offset - commentfocus -> comment_focus - hseparation -> h_separation - ofs -> offset - selectedframe -> selected_frame - state_machine_selectedframe -> state_machine_selected_frame - table_hseparation -> table_h_separation - table_vseparation -> table_v_separation - vseparation -> v_separation
2022-03-13Fix text clipping on the right side.bruvzg
2022-03-04Add optional constructor arguments to more Control nodesHugo Locurcio
This can be used to make editor code more compact. However, as of writing, these constructor arguments cannot be used from the scripting API. This was already provided for Label and CheckBox, but it was missing for other Control nodes where it made sense to provide a default value.
2022-02-15Use `switch` consistently in `_notification` (`scene` folder)Rémi Verschelde
2022-02-08Revert "Add missing SNAME macro optimization to all theme methods call"Rémi Verschelde
This reverts commit a988fad9a092053434545c32afae91ccbdfbe792. As discussed in #57725 and clarified in #57788, `SNAME` is not meant to be used everywhere but only in critical code paths. For theme methods specifically, it was by design that only getters use `SNAME` and not setters.
2022-02-06Add missing SNAME macro optimization to all theme methods calljmb462
2022-01-30Fix button icon_color_disabled alpha channelmashumafi
2022-01-18Improve locale detection.bruvzg
Use separate language, script and country lists. Add locale selection dialog and property hint.
2022-01-10Merge pull request #55225 from bruvzg/fix_ligature_cursor_and_ot_featuresRémi Verschelde
2022-01-09Fix button multiline text alignment.bruvzg
2022-01-09[TextServer] Improve ligature cursor handling.bruvzg
Fix mid-grapheme hit test. Fix OpenType features property handling, add default features override option. Enable mid-grapheme cursor by default.
2022-01-05Merge pull request #54441 from ↵Rémi Verschelde
Geometror/checkbutton-checkbox-font-hover-pressed-color
2022-01-03Update copyright statements to 2022Rémi Verschelde
Happy new year to the wonderful Godot community!
2021-12-09Replace String comparisons with "", String() to is_empty()Nathan Franke
Also: - Adds two stress tests to test_string.h - Changes to .empty() on std::strings
2021-12-09align to horizontal_alignment, valign to vertical_alignment, relatedNathan Franke
2021-12-06Rename minimum_size_changed() methodkobewi
2021-10-31Fix CheckButton and CheckBox font hover pressed colorHendrik Brucker
Co-authored-by: Kjetil Fosse <kjetil.fosse@outlook.com>
2021-10-26Add focus font color to Button and derivativesYuri Sizov
2021-10-09Fix missing argument names in bindingsRémi Verschelde
While at it, tweak some boolean setters to use `p_enabled` for the bool. Also renames `draw_minimap()` to `set_draw_minimap()`.
2021-07-29Add `auto_translate` toggle for automatic translationMichael Alexsander
2021-07-18Optimize StringName usagereduz
* 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-06-29Add alignment options to icons on buttons.jitspoe
They can now be centered and right-aligned. Fixes #11380.
2021-06-19Rename `instance()`->`instantiate()` when it's a verbLightning_A
2021-05-25Tweak dozens of editor property hints for consistencyHugo Locurcio
- Update Viewport MSAA property hints to match the currently exposed values. - Add some performance hints to property hints.
2021-02-22Add preview Sun and Environmentreduz
* Adds both a preview sun and preview environment to the 3D editor. * They are valid as long as a DirectionalLight3D and WorldEnvironment are not in the scene. * If any is added to the scene, the respective preview is disabled. * Changed WorldEnvironment to better handle multiple node versions. * Added a function in SceneTree to get the first node in a group. * Fixed button minimum size to also consider font height if no text is there, this broke with the TextSever PR.
2021-02-10Removed _change_notifyreduz
-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-09Initialize class variables with default values in scene/ [2/2]Rafał Mikrut
2021-01-31Use integer coordinates for the font glyphs rendering.bruvzg
2021-01-24Change themes *_color_* to *_*_colorMarcel Admiraal
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-01Update copyright statements to 2021Rémi Verschelde
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 🎆
2020-12-23Rename Control margin to offsetMarcel Admiraal
2020-11-26[Complex Text Layouts] Refactor Font class, default themes and controls to ↵bruvzg
use Text Server interface. Implement interface mirroring. Add TextLine and TextParagraph classes. Handle UTF-16 input on macOS and Windows.
2020-11-07Reorganized core/ directory, it was too fatty alreadyreduz
-Removed FuncRef, since Callable makes it obsolete -Removed int_types.h as its obsolete in c++11+ -Changed color names code