summaryrefslogtreecommitdiffstats
path: root/scene/gui/button.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #98036 from bruvzg/para_btn_spacingThaddeus Crews2024-11-101-0/+2
|\ | | | | | | [TextParagraph/Button] Add support for line spacing.
| * [TextParagraph/Button] Add support for line spacing.bruvzg2024-10-101-0/+2
| |
* | Rename internal Button icon to button_icon to match exposed methodsAaron Franke2024-10-291-4/+4
| |
* | Merge pull request #97335 from SlienCode/masterClay John2024-10-241-12/+5
|\ \ | |/ |/| Fix `font_hover_pressed_color` and `icon_hover_pressed_color` not working for no stylebox use on `Button`
| * Fix `font_hover_pressed_color` and `icon_hover_pressed_color` not working ↵Nick Christodoulou2024-09-221-12/+5
| | | | | | | | | | for no stylebox use on `Button` You now don't need to have a `hover_pressed` stylebox to make use of `font_hover_pressed_color` and `icon_hover_pressed_color`.
* | Fix button text autowrap overflow when inside a containerHaoyu Qiu2024-09-241-2/+3
|/
* [Button] Use align_to_largest_stylebox for min. size calculation.bruvzg2024-07-041-1/+1
|
* [Button] Do not include internal margins into base button minimum size.bruvzg2024-06-131-15/+2
|
* [Button] Adds theme option to align button text and icon to either largest ↵bruvzg2024-06-101-10/+34
| | | | or current stylebox.
* Improve button min. size calculation.bruvzg2024-05-161-23/+92
|
* Round the icon's drawing rect when drawing the button风青山2024-05-111-0/+2
| | | | | Each component of the icon's drawing rect needs to be snapped to an integer.
* [Button] Fix theme elements size rounding errors not keeping sufficient ↵bruvzg2024-04-181-1/+1
| | | | space for the text.
* Merge pull request #88615 from ↵Rémi Verschelde2024-02-261-11/+5
|\ | | | | | | | | | | Rindbee/add-h_separation-between-icons-in-CheckButton-and-CheckBox Add a `h_separation` between icons in `CheckButton`/`CheckBox`
| * Add a `h_separation` between icons in `CheckButton`/`CheckBox`风青山2024-02-211-11/+5
| | | | | | | | | | | | | | | | | | | | Previously, the `h_separation` between internal elements and custom elements was added when `text` was not empty. That is, this `h_separation` does not exist when there is a valid custom `icon` but `text` is empty. Now, the `h_separation` between the internal element and the custom element is added when the internal element and any custom element exist (both width are greater than `0`).
* | [Button] Add autowrap feature.bruvzg2024-02-221-2/+44
|/
* Fix forgetting `h_separation` when internal elements exist风青山2024-01-221-7/+8
|
* Make the drawing logic clearer in `Button`Rindbee2024-01-181-214/+267
| | | | | | | | | | | The drawing logic follows the calculation logic in `Button::get_minimum_size`. According to the order of `stylebox`, `icon`, and `text`, and follow properties such as alignment mode, to fill the display space of the button. Add a `Button::_set_h_separation_is_valid_when_no_text` for Button derived classes (like `OptionButton`) that expects a `h_separation` between `icon` and theme icon even if the `text` is empty.
* Register theme properties with ThemeDBYuri Sizov2023-09-111-40/+37
|
* Remove unnecessary validity checks from `Button` and `TextureRect`A Thousand Ships2023-09-061-4/+2
| | | | | The one in `TextureRect` appears to be a leftover from earlier code, and the one in `Button` was copied from there.
* Fix Button text when overrun is not trim nothingHaoyu Qiu2023-08-081-3/+4
|
* Unify and streamline connecting to Resource changeskobewi2023-07-171-3/+2
|
* Fix Button clipping when internal margins existHaoyu Qiu2023-07-141-4/+5
|
* Make `TextureButton` and `Button` update on texture changeNinni Pipping2023-05-291-2/+21
|
* Update size or size cache when toggling `expand_icon` in `Button`Rindbee2023-05-171-0/+4
| | | | | | When the `expand_icon` is switched, the size cache can be updated to solve the issue that the cache cannot be updated when the `OptionButton` is enabled with `fit_to_longest_item`.
* Implement vertical icon alignment for buttonsFlorian Kothmeier2023-05-011-12/+57
|
* Make icons of scripted and custom classes fit the editor UIYuri Sizov2023-03-311-4/+19
| | | | | | | | | | | 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>
* Add more sections to Button and BaseButtonVolTer2023-01-251-1/+5
|
* Removed unused property hints and `Object::get_translatable_strings()`Juan Linietsky2023-01-091-1/+1
| | | | | | | | | | | | | | | | * 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>
* One Copyright Update to rule them allRémi Verschelde2023-01-051-29/+29
| | | | | | | | | | | | | | | | | | | | 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".
* Remove redundant Variant-types initializationsMarkus Sauermann2022-11-141-1/+1
|
* Add a lifecycle method for manual theme item caching to ControlYuri Sizov2022-09-011-44/+88
|
* [TextServer] Add support for trimming edge spaces on line break.bruvzg2022-09-011-1/+1
|
* Rename `CanvasItem.update()` to `queue_redraw()`Micky2022-08-291-13/+13
| | | | | | | | | | 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`.
* Fix case where `h_separation` might not work in `Button`Rindbee2022-08-121-6/+4
| | | | | | 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`.
* Round icon position and size in buttons to make them look sharperYuri Sizov2022-08-051-1/+2
|
* Add fit_to_longest_item to OptionButtonkobewi2022-08-021-37/+56
|
* Use BitField hint for the TextServer enums. Add missing parts for BitField ↵bruvzg2022-07-151-1/+1
| | | | support to the GDextension API.
* Fix regressions from Font refactorbruvzg2022-07-081-1/+5
| | | | | Remove unnecessary font override Fixes button outline draw when it should not, causing button colors to be slightly off
* Refactor Font configuration and import UI, and Font resources.bruvzg2022-07-061-85/+6
|
* Move duplicate AutoWrap, Overrun and VisibleChar behavior enums to the ↵bruvzg2022-06-161-5/+5
| | | | TextServer.
* Add overrun behavior to the Button.bruvzg2022-06-081-3/+21
|
* Merge pull request #60867 from KoBeWi/μtextRémi Verschelde2022-05-171-5/+5
|\ | | | | Remove font height restriction from Button
| * Remove font height restriction from Buttonkobewi2022-05-081-5/+5
| |
* | Fix button icon expansion calculation with empty textHendrik Brucker2022-05-101-1/+2
|/
* Rename theme properties to include underscoresFireForge2022-04-231-9/+9
| | | | | | | | | | | | | | - 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
* Fix text clipping on the right side.bruvzg2022-03-131-1/+1
|
* Add optional constructor arguments to more Control nodesHugo Locurcio2022-03-041-1/+1
| | | | | | | | | 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.
* Use `switch` consistently in `_notification` (`scene` folder)Rémi Verschelde2022-02-151-0/+3
|
* Revert "Add missing SNAME macro optimization to all theme methods call"Rémi Verschelde2022-02-081-1/+1
| | | | | | | | 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.
* Add missing SNAME macro optimization to all theme methods calljmb4622022-02-061-1/+1
|