summaryrefslogtreecommitdiff
path: root/scene/gui/scroll_container.cpp
AgeCommit message (Collapse)Author
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-12-07Fix Determining Window for TouchscreenMarkus Sauermann
DisplayServer::screen_is_touchscreen will likely never utilize its parameter p_screen. This PR replaces this function by DisplayServer::is_touchscreen_available() with the same functionality. This solves the problem, that a SubViewport was used for determining the screen, which resulted in error messages.
2022-11-07Code simplificationsMarkus Sauermann
CanvasItemEditor: - p_result == ADD_MOVE is always true in this switch-clause - both parts of the if-else-clause do the same thing and simplified an affine_inverse call ControlEditorToolbar: - private function ControlEditorToolbar::_anchor_to_position is used nowhere. Looks like copy and paste from CanvasItemEditor::_anchor_to_position ScrollContainer: - screen_is_touchscreen is always true, because otherwise the function already returned TextLine: - both parts of the if-else-clause do the same thing and simplified return statement
2022-10-18Use more reasonable scrollable conditions in `ScrollContainer`Rindbee
The visibility of the `ScrollBar` was used as a condition for judging whether it should scroll. **Visible** and **scrollable** are currently not the same in some cases (`SCROLL_MODE_SHOW_NEVER`). This makes `SCROLL_MODE_SHOW_NEVER` not working properly. This patch will make `SCROLL_MODE_SHOW_NEVER` available, so that the external `SrollBar` can share the internal `ScrollBar`'s data, we can achieve the purpose of replacing the internal `ScrollBar` with a custom external one.
2022-09-29Fix ScrollContainer touch-scrolling not working.Zae
2022-09-19Change return type of `get_configuration_warnings` to `PackedStringArray`Marc Gilleron
2022-09-06Improve naming of theme properties throughout GUI codeYuri Sizov
Rename ItemList's bg -> panel Rename ItemList's bg_focus -> focus Rename ProgressBar's bg -> background Rename ProgressBar's fg -> fill Rename Tree's bg -> panel Rename Tree's bg_focus -> focus Rename ScrollContainer's bg -> panel Rename FileDialog's *_icon_modulate -> *_icon_color Rename FileDialog's files_disabled -> file_disabled_color Rename CheckButton's on/off -> checked/unchecked Rename check_v_adjust -> check_v_offset
2022-09-01Add a lifecycle method for manual theme item caching to ControlYuri Sizov
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-29Revert "Remove NOTIFICATION_ENTER_TREE when paired with ↵Rémi Verschelde
NOTIFICATION_THEME_CHANGED" This reverts commit 4b817a565cab8af648c88cfc7ab6481e86ee3625. Fixes #64988. Fixes #64997. This caused several regressions (#64988, #64997, https://github.com/godotengine/godot/issues/64997#issuecomment-1229970605) which point at a flaw in the current logic: - `Control::NOTIFICATION_ENTER_TREE` triggers a *deferred* notification with `NOTIFCATION_THEME_CHANGED` as introduced in #62845. - Some classes use their `THEME_CHANGED` to cache theme items in member variables (e.g. `style_normal`, etc.), and use those member variables in `ENTER_TREE`, `READY`, `DRAW`, etc. Since the `THEME_CHANGE` notification is now deferred, they end up accessing invalid state and this can lead to not applying theme properly (e.g. for EditorHelp) or crashing (e.g. for EditorLog or CodeEdit). So we need to go back to the drawing board and see if `THEME_CHANGED` can be called earlier so that the previous logic still works? Or can we refactor all engine code to make sure that: - `ENTER_TREE` and similar do not depend on theme properties cached in member variables. - Or `THEME_CHANGE` does trigger a general UI update to make sure that any bad theme handling in `ENTER_TREE` and co. gets fixed when `THEME_CHANGE` does arrive for the first time. But that means having a temporary invalid (and possibly still crashing) state, and doing some computations twice which might be heavy (e.g. `EditorHelp::_update_doc()`).
2022-08-27Remove NOTIFICATION_ENTER_TREE when paired with NOTIFICATION_THEME_CHANGEDAaron Record
2022-07-31Fix toggling after scrolling resulted in blank spaceRindbee
Previously, the data used by `update_scrollbars()` and `_update_dimensions()` in their calculations depended on each other, which caused some problems. Now, the calculation of `child_max_size` is put into `get_minimum_size()`, as the containers call `update_minimum_size()` before calling `queue_sort()`. Make the semantics of variable/function names more clear. Co-authored-by: Aaron Record <aaronjrecord@gmail.com>
2022-07-22Merge pull request #62093 from Rindbee/fix-undecided-min_size-in-ScrollContainerRémi Verschelde
2022-07-22Merge pull request #63295 from ↵Rémi Verschelde
winterpixelgames/master-allow-scroll-container-scroll-to-be-set-instantly
2022-07-21Call update_scrollbars() in sort_children() so the max is set properly so ↵Jason Knight
you can set scroll_container.scroll_vertical instantly after adding children to a scroll container.
2022-07-21Fix indeterminate minimum size in ScrollContainerRindbee
2022-06-11Add suffixes to all nodes and resourcesFireForge
2022-03-28String: Remove TTR and DTR defines in non-tools buildRémi Verschelde
This ensures we don't use TTR in runtime code, as it's specifically meant to source translations for the editor.
2022-02-15Use `switch` consistently in `_notification` (`scene` folder)Rémi Verschelde
2022-02-12Improve compilation speed (forward declarations/includes cleanup)Hendrik Brucker
2022-01-03Update copyright statements to 2022Rémi Verschelde
Happy new year to the wonderful Godot community!
2022-01-03Merge pull request #55487 from YeldhamDev/scroll_bikesheddingRémi Verschelde
2021-12-07ScrollContainer's scrollbar visibility is now enumkobewi
2021-12-06Rename minimum_size_changed() methodkobewi
2021-11-30Rename all methods that return `ScrollBar` nodes to `get_*_scroll_bar()`Michael Alexsander
2021-11-16Fix style issue after #54148Rémi Verschelde
2021-11-16Merge pull request #54148 from miraz12/fix-scrollContrainer-notification-crashRémi Verschelde
2021-11-12Use "enum class" for input enumsAaron Franke
2021-10-23 Fixed crash in `ScrollContainer` _notificationAnton Christoffersson
2021-09-23Construct values only when necessary.Anilforextra
2021-08-28Add support for internal nodeskobewi
2021-08-23Entirely removes BIND_VMETHOD in favor of GDVIRTUALreduz
* `_gui_input`, `_input`, `_unhandled_input` and `_unhandled_key_input` are now regular C++ virutal functions. * Everything else converted to GDVIRTUAL * BIND_VMETHOD is gone, always use the new syntax from now on. Creating `_gui_input` method and using the binder to register events will no longer work, simply override the virtual function now.
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-29Merge pull request #49719 from LightningAA/rename-node-is-ancestor-ofRémi Verschelde
Rename `is_a_parent_of()` to `is_ancestor_of()`
2021-06-25Remove clips_input() method and use clip_contentkobewi
2021-06-21Rename `is_a_parent_of()` to `is_ancestor_of()`Lightning_A
2021-06-01Merge pull request #48770 from ↵Rémi Verschelde
LightningAA/scrollcontainer-ensure-item-visible-4.0 ScrollContainer: Expose `_ensure_focused_visible` to the scripting API and rename it to `ensure_control_visible`
2021-05-31ScrollContainer: Expose `_ensure_focused_visible` to the APILightning_A
Was renamed to `ensure_control_visible`
2021-05-07Rename "Control" key to "Ctrl" and add "_pressed" suffix to all ↵Lightning_A
InputEventWithModifiers properties/methods
2021-04-28Add the ability to hide scrollcontainer's scrollbarsLightning_A
2021-04-11Use Array for node configuration warningsNathan Franke
Previously, the warnings were passed as a string and delimitation of which were hard coded at each implementation.
2021-04-05Fix crashes in *_input functionsRafał Mikrut
2021-03-23Rename ButtonList enum and members to MouseButtonAaron Franke
2021-02-09Initialize class variables with default values in scene/ [2/2]Rafał Mikrut
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-29Allow ScrollBar params of a ScrollContainer to be modified in _ready()Maganty Rushyendra
Initializes the sizes of the ScrollContainer and its associated ScrollBars in _ready() to allow scroll values to be set in GDScript initially.
2020-12-28Rename empty() to is_empty()Marcel Admiraal
2020-12-23Merge pull request #44605 from madmiraal/rename-control-marginRémi Verschelde
Rename Control margin to offset
2020-12-23Rename Control margin to offsetMarcel Admiraal
2020-12-21Use integer text position in scroll container, TextEdit and canvas editor, ↵bruvzg
to ensure sharp text rendering. Use integer font align/advance with any font scaling, to ensure sharp text rendering.