Commit Graph

234 Commits

Author SHA1 Message Date
Eric M af438ae742 Ensure popup menu redraws items when shortcuts update. 2022-09-26 23:21:32 +10:00
Michael Alexsander 9507e91c07 Rename `PopupMenu`'s `set/get_current_index()` to `set/get_focused_item()` 2022-09-06 10:51:14 -03:00
Jonathan Nicholl 15d057c521 Add `is_zero_approx` methods to `Vector2`, `3`, and `4` 2022-09-02 00:29:50 -04:00
Yuri Sizov 15fd025f90 Add dumb and manual theme caching systems to Window 2022-09-01 16:05:02 +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
Rémi Verschelde f647292df5
Merge pull request #64960 from YeldhamDev/more_hl_stuff 2022-08-29 08:05:33 +02:00
Michael Alexsander 221344b9e2 Fix some corner cases in the `Menu/OptionButton` item auto-highlight 2022-08-28 01:15:03 -03:00
Michael Alexsander 06df59887b Fix crash when pressing up on an empty `PopupMenu` 2022-08-27 18:13:27 -03: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
bruvzg 8c56a7416b
Implement `MenuBar` control to wrap `PopupMenu`s or native menu, use native menu for editor. 2022-08-18 22:25:44 +03:00
kobewi e06cd2742f Add missing properties to default theme 2022-08-11 14:15:04 +02:00
FireForge 97dfbea6ad Rename Control PRESET_WIDE to PRESET_FULL_RECT 2022-07-18 20:08:11 -05:00
bruvzg 344ba0ffaf
Refactor Font configuration and import UI, and Font resources. 2022-07-06 14:12:36 +03:00
FireForge f85eb4164a Expose PopupMenu set/get_item_horizontal_offset()
- Renames setter from set_item_h_offset()
- Adds getter
2022-06-15 02:08:44 -05:00
bruvzg f7269fe878
Single-window mode popups and edited scene windows fixes.
Fix single-window mode popup not closing when OptionBox is clicked.
Fix single-window mode submenus closing when parent menu item, that was used to open it is clicked (using same safe-area logic as platform specific code).
Disallow windows that are part of an edited scene from being set as exclusive or popup to prevent it from locking up the editor.
2022-06-13 09:56:08 +03:00
FireForge 4678736a39 Add suffixes to all nodes and resources 2022-06-11 09:41:05 -05:00
Rémi Verschelde 9101c5b499
Merge pull request #52624 from e8newallm/52577
Corrected ordering of Left/Top/Right/Bottom properties
2022-04-28 17:57:02 +02:00
FireForge 3073b85de9 Rename theme properties to include underscores
- 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-04-23 11:16:18 -05:00
Michael Alexsander bab2f3c021 Add `font_separator` and related properties to `PopupMenu` 2022-04-13 23:46:35 -03:00
Michael Alexsander 59c3d4e17f Fix and tweak labeled separator in `PopupMenu` 2022-04-13 17:13:29 -03:00
bruvzg 8b0761d1fd
Fix sub-menu keyboard navigation. 2022-04-13 09:58:38 +03:00
风青山 f789c17690 Fix text buf does not clear when calling the method set_item_text in PopupMenu 2022-03-15 21:49:00 +08:00
kobewi 42078dec9f Allow negative indexes in ItemList and PopupMenu 2022-03-12 01:14:03 +01:00
kobewi 7d44bb8f06 Remove set_as_minsize() 2022-03-06 00:57:42 +01:00
bruvzg 74ff5921d6 Improve popup window handling.
Add window FLAG_POPUP and a platform specific routines to control popup auto-hiding and event forwarding.
2022-02-25 09:33:27 +02:00
Rémi Verschelde 0f5455230c
Use `switch` consistently in `_notification` (`scene` folder) 2022-02-15 18:44:55 +01:00
Hendrik Brucker b396fd4eef Improve compilation speed (forward declarations/includes cleanup) 2022-02-12 02:46:22 +01:00
Rémi Verschelde 196801fc64
Merge pull request #57837 from YeldhamDev/that_was_pointless 2022-02-09 09:38:39 +01:00
Michael Alexsander ef81dc1831 Remove code to update the layout direction of submenus from `PopupMenu` 2022-02-09 01:36:20 -03:00
Markus Sauermann 35806c1511 Adjust id creation in PopupMenu to avoid duplicate ids 2022-02-09 01:17:55 +01:00
Rémi Verschelde b6ddf4a629
Merge pull request #57692 from YeldhamDev/popping_options 2022-02-08 14:04:28 +01:00
Rémi Verschelde fc076ece3d
Revert "Add missing SNAME macro optimization to all theme methods call"
This reverts commit a988fad9a0.

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-08 10:17:25 +01:00
Rémi Verschelde b024602660
Merge pull request #57725 from jmb462/missing-sname-theme-setters 2022-02-07 11:46:25 +01:00
Michael Alexsander 8bde86da10 Make popups from `MenuButton`, `OptionButton`, and submenus obey the layout direction 2022-02-06 23:07:08 -03:00
jmb462 a988fad9a0 Add missing SNAME macro optimization to all theme methods call 2022-02-06 23:06:11 +01:00
Michael Alexsander 989caab0ad Better handle icons and checkboxes with separators in `PopupMenu` 2022-02-06 16:05:45 -03:00
Michael Alexsander 21bf23d966 Enhancements and fixes for `OptionButton` and `PopupMenu` 2022-02-06 16:03:18 -03:00
Rémi Verschelde 5e39a8eded
Merge pull request #56992 from YeldhamDev/smarter_popmenu_focus 2022-02-03 17:15:06 +01:00
eikobear 3b146c5eaa Make various improvements to OptionButton
- Allow OptionButton selection to be set to -1 to signify no selection, both via API and in the editor.
- Reset OptionButton selection to -1 when the selected item has been removed.
- Fully convert PopupMenu to a zero-based ID system, which improves an inconsistency in generated IDs when making new items in the editor.
2022-01-28 17:03:45 -05:00
Michael Alexsander 73c225838f Make popup menus focus items automatically when not using the mouse 2022-01-25 13:51:56 -03:00
bruvzg 5a97184931 [Windows] Fix pop-up dialogs instantly closing. 2022-01-20 16:51:35 +02:00
Ricardo Buring 4562106cbf OptionButton::pressed(): give focus to selected 2022-01-15 22:52:12 +01:00
Rémi Verschelde cb7daddbeb
Merge pull request #54647 from rafallus/fix/popupmenu_ids
Fix `PopupMenu` items id range in inspector
2022-01-08 11:39:09 +01:00
rafallus 38d578e24e Fix `PopupMenu` items id range in inspector 2022-01-07 19:58:09 -06: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 1032c2c434
Merge pull request #55487 from YeldhamDev/scroll_bikeshedding 2022-01-03 14:10:41 +01:00
Rémi Verschelde bdf8340e59
Merge pull request #43181 from nathanfranke/string-empty
Replace String comparisons with "", String() to is_empty()
2021-12-10 08:56:31 +01:00
FelipeMatoba 29178d3564 Increased time delay on selection when opening a popup 2021-12-09 16:44:56 -03: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
kobewi 347e50f73b Improve PopupMenu doc about id and index 2021-12-08 13:02:42 +01:00