Commit Graph

148 Commits

Author SHA1 Message Date
aeb3a45c97 Hide Control focus when given via mouse input 2025-09-19 13:43:29 -03:00
5c59a75923 Fix OptionButton not removing icon when using clear 2025-08-19 10:55:42 +02:00
34a97f9c9b Fix scale and position of popups with force_native. 2025-06-16 13:03:42 +03:00
454e4f817c Make build profile project detection also set build options 2025-06-03 11:11:33 -03:00
cf7e88f6ac Fix option_button.cpp not updating selected when out of bounds 2025-05-23 13:00:31 -07:00
b106dfd4f9 Base accessibility API. 2025-04-08 20:14:28 +03:00
82a0290871 Add auto translate mode for items in PopupMenu and OptionButton 2025-03-09 23:50:11 +08:00
466590d0ec Use get_slicec instead of get_slice for single character splitters 2025-03-08 20:36:37 +01:00
25fd115957 Fix OptionButton::show_popup 2025-01-21 21:37:19 +08:00
5c63646e87 Change print warnings to config ones for popups that need transparency 2025-01-09 15:59:56 -03: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
b1526f45b8 Merge pull request #97890 from timothyqiu/id-focused
Fix `PopupMenu.id_focused` signal using index as ID
2024-11-12 12:13:16 -06:00
562c666e3d Rename internal Button icon to button_icon to match exposed methods 2024-10-29 16:23:03 -07:00
a328952fc1 Fix PopupMenu.id_focused signal using index as ID 2024-10-07 00:19:16 +08:00
5279fec60f Always store ID of PopupMenu items 2024-08-20 15:33:21 +02:00
af5fc8354b Fix a bunch of orphan StringName errors at ProjectSettings/Editor exit 2024-07-09 19:38:52 +03:00
d9e2fc74c7 [Scene] Add SceneStringNames::item_selected 2024-06-19 09:39:05 +02:00
ea379e3b3a Improve button min. size calculation. 2024-05-16 22:37:12 +03:00
7705265477 Fix PropertyListHelper::_get_property returning a valid value even if an index is outside the array valid indices
Co-authored-by: Tomasz Chabora <kobewi4e@gmail.com>
2024-05-10 10:46:04 +02:00
e95e954c68 Add PropertyListHelper in all simple cases 2024-04-11 18:13:29 +02:00
5de496d3b0 Add a h_separation between icons in CheckButton/CheckBox
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`).
2024-02-21 17:53:07 +08:00
02f4a66c1f Merge pull request #88145 from Ratamacue9112/tweak-option-button-property-order
Tweak property order in the inspector for OptionButton
2024-02-17 18:31:47 +01:00
45b9cbd904 Tweak property order in the inspector for OptionButton 2024-02-17 11:03:16 +00:00
7b42c24550 Make auto translation inheritable 2024-02-15 16:51:19 -03:00
f29a7d302e Make the drawing logic clearer in Button
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.
2024-01-18 22:57:22 +08:00
a3cb1b096f Add const references detected by clang-tidy 2023-12-16 13:36:44 -05:00
2924bfd4d3 Register theme properties with ThemeDB 2023-09-11 13:45:23 +02:00
0fff0b1054 Merge pull request #80203 from WhalesState/Dev2
Add shortcut handling to `OptionButton`
2023-08-17 11:24:14 +02:00
5dd854513e Fix OptionButton min size when fit longest item is enabled 2023-08-07 17:25:10 +08:00
2cec27a3f1 Add shortcut handling to OptionButton 2023-08-03 08:38:20 +00:00
5384c1a579 Update OptionButton min size when disabling Fit to Longest Item 2023-07-15 11:10:23 +08:00
c33748d954 Fix invalid minimum size for translated messages in option button 2023-06-29 15:01:36 +02:00
9bd1d3b5c8 Update size or size cache when toggling expand_icon in Button
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`.
2023-05-17 06:06:25 +08:00
57e3651763 Merge pull request #72028 from kilojool/option_button_reselection
OptionButton: allow reselection of selected item
2023-04-03 17:06:36 +02:00
150f89352b Auto translate popup menus of MenuButton and OptionButton
Currently, `auto_translate` property of a `MenuButton` or `OptionButton`
won't affect its popup menu. It's okay if you want to auto translate,
but requires extra setup if you don't.
2023-03-27 18:09:24 +08:00
084a4addc4 Fix Screen-Transform missing in Button Size in OptionButton::show_popup
The button size is affected by the screen transform, which was previously
not taken into consideration.
2023-02-06 20:58:57 +01:00
8b008757db OptionButton: allow reselection of selected item 2023-01-25 15:11:48 +01:00
0e0a6bb39b Removed unused property hints and Object::get_translatable_strings()
* 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-09 16:56:01 +01: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
95597bb2ac Fix position and size of OptionButton PopupMenu
Use the correct Transform2D (get_global_transform_with_canvas) for
position and size.
2022-11-12 21:12:02 +01:00
1778301cd0 Add call_deferred() method to Callable 2022-11-04 17:24:34 +01:00
272c297931 Improve MenuButton and OptionButton
* MenuButton + OptionButton: Add method `show_popup()` which performs required popup setup before showing (prefer use of this over `get_popup()->popup()`, otherwise GH #66308 occurs)
* MenuButton: Ensure that the menu can be opened with a shortcut, if one is set for the button. (GH #66403). Ensure that popupmenu item shortcuts are checked first before the MenuButton shortcut.
2022-10-03 20:07:39 +10:00
9507e91c07 Rename PopupMenu's set/get_current_index() to set/get_focused_item() 2022-09-06 10:51:14 -03:00
3b1aa240dc Add a lifecycle method for manual theme item caching to Control 2022-09-01 16:35:36 +03:00
221344b9e2 Fix some corner cases in the Menu/OptionButton item auto-highlight 2022-08-28 01:15:03 -03:00
ac7b5111f5 Merge pull request #64768 from bruvzg/popups_hide_if_visible 2022-08-26 11:59:50 +02:00
b7d2ba12c8 Merge pull request #64635 from YeldhamDev/menu_buttons_popup_fix
Make `Menu/OptionButton` item auto-highlight behave better
2022-08-24 19:07:25 +02:00
cd095ab64a Hide MenuButton / OptionButton popup on click if it's already visible. 2022-08-23 10:38:51 +03:00
b9ea0e1338 Merge pull request #64218 from Rindbee/fix-button-minimum-size-calculation 2022-08-22 22:40:59 +02:00
1a24c9e14b Make _validate_property a multilevel method 2022-08-22 18:35:11 +03:00