Commit Graph

160 Commits

Author SHA1 Message Date
风青山 b887d57671 Make the OptionButton match the width of the pop-up menu
The difference in width compared to the popup is due to the potentially
different widths of the dedicated icons/styleboxes.

Make the width at least the width of the popup.
2026-06-09 08:25:57 +08:00
Mikael Hermansson 4540e1d179 Split PopupMenu.search_bar_enabled_on_item_count into two properties 2026-05-09 03:43:21 +02:00
Mikael Hermansson 33628f79ff Fix PopupMenu fuzzy searching and expose fuzzy search properties 2026-05-07 15:12:17 +02:00
Pāvels Nadtočajevs 2c2ed8ddb5 [Editor] Generate and display documentation for the properties generated by PropertyListHelper. 2026-03-18 11:26:03 +02:00
Thaddeus Crews 891069d1cd Merge pull request #114236 from warriormaster12/san-popupmenu-search-bar
Implement search bar for `PopupMenu`
2026-03-04 11:20:49 -06:00
Rémi Verschelde eabb9a63d4 Rename callable_method_pointer.h to callable_mp.h and include it explicitly
This allows removing it from `class_db.h`, significantly reducing the amount of files
that include it transitively.

Also includes some include cleanup in `control.h` and `rich_text_label.h` done while
ensure they don't depend on `callable_mp`.
2026-03-04 16:23:23 +01:00
warriormaster12 18e989c49e Implement search bar to PopupMenu 2026-03-03 22:35:06 +02:00
Pāvels Nadtočajevs 1306221592 Move accessibility methods/enums from DisplayServer to the AccessibilityServer dedicated singleton. 2026-03-02 13:48:29 +02:00
Thaddeus Crews e380a41752 Style: Add class_db.h includes explicitly 2026-02-26 15:50:28 -06:00
kobewi f7b9703cbd Use actual class names in resource type hints 2026-01-29 21:07:56 +01:00
Joshua Bordelon 72ed25ea24 Fix OptionButton PopupMenu not shrinking after item changes
Fixes #114786. Reset min_size before popup to prevent clamping to old size. Move shrink_width to constructor following PR #114760 style.
2026-01-09 14:37:12 -06:00
Pāvels Nadtočajevs 64277e6101 Make PopupMenu shrinking configurable. 2025-12-30 08:33:41 +02:00
Michael Alexsander aeb3a45c97 Hide Control focus when given via mouse input 2025-09-19 13:43:29 -03:00
Giganzo 5c59a75923 Fix OptionButton not removing icon when using clear 2025-08-19 10:55:42 +02:00
Pāvels Nadtočajevs 34a97f9c9b Fix scale and position of popups with force_native. 2025-06-16 13:03:42 +03:00
Michael Alexsander 454e4f817c Make build profile project detection also set build options 2025-06-03 11:11:33 -03:00
chansoen cf7e88f6ac Fix option_button.cpp not updating selected when out of bounds 2025-05-23 13:00:31 -07:00
Pāvels Nadtočajevs b106dfd4f9 Base accessibility API. 2025-04-08 20:14:28 +03:00
Haoyu Qiu 82a0290871 Add auto translate mode for items in PopupMenu and OptionButton 2025-03-09 23:50:11 +08:00
A Thousand Ships 466590d0ec Use get_slicec instead of get_slice for single character splitters 2025-03-08 20:36:37 +01:00
scgm0 25fd115957 Fix OptionButton::show_popup 2025-01-21 21:37:19 +08:00
Michael Alexsander 5c63646e87 Change print warnings to config ones for popups that need transparency 2025-01-09 15:59:56 -03:00
Yufeng Ying 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
Thaddeus Crews 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
Aaron Franke 562c666e3d Rename internal Button icon to button_icon to match exposed methods 2024-10-29 16:23:03 -07:00
Haoyu Qiu a328952fc1 Fix PopupMenu.id_focused signal using index as ID 2024-10-07 00:19:16 +08:00
kobewi 5279fec60f Always store ID of PopupMenu items 2024-08-20 15:33:21 +02:00
Yuri Rubinsky af5fc8354b Fix a bunch of orphan StringName errors at ProjectSettings/Editor exit 2024-07-09 19:38:52 +03:00
A Thousand Ships d9e2fc74c7 [Scene] Add SceneStringNames::item_selected 2024-06-19 09:39:05 +02:00
bruvzg ea379e3b3a Improve button min. size calculation. 2024-05-16 22:37:12 +03:00
Gilles Roudière 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
kobewi 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
Rémi Verschelde 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
Ratamacue9112 45b9cbd904 Tweak property order in the inspector for OptionButton 2024-02-17 11:03:16 +00:00
Michael Alexsander 7b42c24550 Make auto translation inheritable 2024-02-15 16:51:19 -03:00
Rindbee 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
Wilson E. Alvarez a3cb1b096f Add const references detected by clang-tidy 2023-12-16 13:36:44 -05:00
Yuri Sizov 2924bfd4d3 Register theme properties with ThemeDB 2023-09-11 13:45:23 +02:00
Rémi Verschelde 0fff0b1054 Merge pull request #80203 from WhalesState/Dev2
Add shortcut handling to `OptionButton`
2023-08-17 11:24:14 +02:00
Haoyu Qiu 5dd854513e Fix OptionButton min size when fit longest item is enabled 2023-08-07 17:25:10 +08:00
Mounir Tohami 2cec27a3f1 Add shortcut handling to OptionButton 2023-08-03 08:38:20 +00:00
Haoyu Qiu 5384c1a579 Update OptionButton min size when disabling Fit to Longest Item 2023-07-15 11:10:23 +08:00
Florian Kothmeier c33748d954 Fix invalid minimum size for translated messages in option button 2023-06-29 15:01:36 +02:00
Rindbee 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
Rémi Verschelde 57e3651763 Merge pull request #72028 from kilojool/option_button_reselection
OptionButton: allow reselection of selected item
2023-04-03 17:06:36 +02:00
Haoyu Qiu 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
Markus Sauermann 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
kilojool 8b008757db OptionButton: allow reselection of selected item 2023-01-25 15:11:48 +01:00
Juan Linietsky 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