Commit Graph

249 Commits

Author SHA1 Message Date
fe000277ea Bind remaining theme properties to their respective classes
This adds binds for GraphEdit/GraphElement/GraphNode, which were
skipped before due to a rework. This also adds binds for Window,
which was skipped before due to a complicated code organization.

Also adds theme cache entries/direct cache access to a few places
that previously missed it. Some theme properties are now exposed
to other classes via friendships or public getters for convenience.

This removes all string-based theme access from scene/ classes.
2023-09-13 19:31:35 +02:00
2924bfd4d3 Register theme properties with ThemeDB 2023-09-11 13:45:23 +02:00
6de34fde27 Add EditorStringNames singleton 2023-09-03 19:58:18 +02:00
14256a2395 Merge pull request #78468 from KoBeWi/enmarginalization
Fix ColorPicker margin theme property
2023-08-08 16:55:32 +02:00
d934d00828 Remove spaces from input of HTML color in color picker
Fixes #79338
2023-07-22 12:11:28 +02:00
a29a680920 Extract StyleBoxFlat, StyleBoxTexture and StyleBoxLine in their own file 2023-07-17 13:25:00 +02:00
7e21eb7e00 Extract and reorganize texture resource classes 2023-07-14 20:04:21 +02:00
3f02b0cfde Moved HSV and OKHSL caching logic into color_mode 2023-07-05 07:15:58 -07:00
e11e9d2b9a Use cached saturation for color picker when value is 0 2023-06-21 15:18:20 -07:00
9c3afcc898 Fix ColorPicker margin theme property 2023-06-20 12:47:52 +02:00
a374c7d519 Use cached hue for color picker when saturation is 0
Fixes #76968.
2023-06-12 10:59:33 +02:00
0f0f233d37 Merge pull request #76751 from anvilfolk/swatch
Fix adding colors to swatches not updating in previous ColorPickers.
2023-05-22 13:48:43 +02:00
a132ed0ca4 Fix adding colors to swatches not updating in previous ColorPickers.
ColorPicker was only updating colors if its swatches were empty. It
should always update from the cache in case some other ColorPicker
updated the swatch cache.
2023-05-21 17:50:14 -04:00
b76ddeda45 Improve color picking 2023-05-19 14:21:43 +02:00
e758164ba6 Merge pull request #72376 from MewPurPur/fix-color-button-popup
Fix popup position of color picker
2023-05-08 12:20:07 +02:00
14cb9b5b26 Add center_grabber property to Slider 2023-04-22 17:53:17 +02:00
87b8eea9f6 Merge pull request #75904 from Calinou/colorpicker-constructor-round-values
Round values to 3 decimals in the ColorPicker constructor string
2023-04-13 09:54:18 +02:00
4d8331ad1f Round values to 3 decimals in the ColorPicker constructor string
This makes the whole string always fit within the LineEdit
(at least when using the default font).
2023-04-11 18:29:52 +02:00
517dc3654a Allow entering named colors in ColorPicker's hex field
This also makes the hex field wider to allow displaying 9-character
hex code (`#rrggbbaa`) in full, even when using a custom font.
2023-04-10 23:59:07 +02:00
e401540264 Implement theme item cache in ColorPicker and friends 2023-04-03 18:01:11 +02:00
b90d70d592 Merge pull request #72764 from Sauermann/fix-color-picking
Fix Color Picking
2023-02-17 00:33:20 +01:00
3542d24fda Fix HSV Rectangle Wheel values 2023-02-13 01:18:44 +01:00
888add8418 Fix Color Picking
With the 4.x-introduction of Windows the previous method for
color picking was no longer working.

This PR uses the following approach to reintroduce color-picking.
When the Color-Picking-Button is pressed, a quasi-screenshot of the
Window-content is created and displayed in a new Popup-Window.
This new Window allows selecting colors by Mouse-Click.
A Preview of the targeted Color is also displayed.
2023-02-09 01:00:54 +01:00
040e258164 Fix popup position of color picker 2023-01-30 14:04:45 +01:00
5068d82374 Merge pull request #71686 from YuriSizov/stylebox-min-size-but-better
Clean-up, harmonize, and improve StyleBox API
2023-01-22 17:53:04 +01:00
906ee0b219 Merge pull request #67253 from KoBeWi/PICKER_USAGE_NO_EDITOR
Remove editor dependencies from ColorPicker
2023-01-21 20:52:16 +01:00
752402cf35 Clean-up, harmonize, and improve StyleBox API
- Make all margin properties follow the same naming convention (their getter and setter too).
- Remove a virtual counterpart of `get_style_margin` from API.
- Allow to override `get_minimum_size` from scripting and remove `get_center_size`.
2023-01-19 20:02:21 +03:00
59ea36b87c Remove set_drag_forwarding_compat() 2023-01-14 15:16:51 +01:00
e6a4debede Change set_drag_forwarding() to use callables.
* This solution is much cleaner than the one in 3.x thanks to the use of callables.
* Works without issues in any language (no need to worry about camel or snake case).
* Editor code uses a compatibility function (too much work to redo).

Fixes #59899
2023-01-10 14:09:24 +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
b04bc49443 Merge pull request #68255 from jbcolli2/ColorPickerBug
Fixed Issue #68194 involving ColorPicker being allowed to align horizontally when it shouldn't
2022-12-21 22:25:14 +01:00
ebf4f75c54 Merge pull request #68855 from Cafalaarl/Cafalaarl/master
Fixed incorrect gradient orientation in HSV vertical slider
2022-11-22 08:29:12 +01:00
28af870750 Code simplifications found by cppcheck
They are based on:
- Boolean arithmetic simplifications
- setting variables that are not accessed
- constant variables
2022-11-21 08:43:36 +01:00
b29f7c2fe8 Fixed orientation of HSV rectangle vertical slider 2022-11-19 10:51:56 +13:00
c685c47f8a Fixed ColorPicker so the vertical option is not available in editor. 2022-11-04 13:59:25 -04:00
286e7da162 Modularize the Color Picker via properties. 2022-11-04 00:08:46 -04:00
33c7c8020a Merge pull request #67489 from timothyqiu/auto-select-all
Allow selecting SpinBox & LineEdit text when focus enters
2022-10-31 11:55:06 +01:00
420eb1aa34 Merge pull request #67445 from Zylann/rename_queue_delete
Rename queue_delete => queue_free
2022-10-31 10:51:18 +01:00
d831ba1d6f Merge pull request #67534 from KoBeWi/more_OK_in_OKHSL
Improve ColorPicker sliders in OKHSL mode
2022-10-31 10:37:27 +01:00
3aed3edc06 Allow selecting SpinBox & LineEdit text when focus enters 2022-10-29 09:58:42 +08:00
7543a5e014 Rename queue_delete => queue_free
# Conflicts:
#	editor/plugins/tiles/tiles_editor_plugin.cpp
2022-10-24 22:07:02 +01:00
b42c1f82fc Improve ColorPicker sliders in OKHSL mode 2022-10-18 23:59:55 +02:00
b8031bb7d6 Code simplifications
1. Viewport::get_visible_rect().position is always zero.
So Control::get_window_rect is identical to Control::get_global_rect.
Remove Control::get_window_rect since it is not used in the source code.

2. sqrt(a * a) = abs(a) for doubles

3. Simplify affine_inverse combination

4. Simplify calculation in shaders
2022-10-18 12:47:40 +02:00
a3661ad079 Remove editor dependencies from ColorPicker 2022-10-11 16:09:27 +02:00
8017827144 SCons: Re-enable treating #warning as error with werror
Replace all TODO uses of `#warning` by proper TODO comments, and will open
matching bug reports to keep track of them.

We don't have a great track record fixing TODOs, but I'd wager we're even
worse for fixing these "TODO #warning" so we should prohibit this usage.
2022-10-10 16:12:26 +02:00
0103af1ddd Fix MSVC warnings, rename shadowed variables, fix uninitialized values, change warnings=all to use /W4. 2022-10-07 11:32:33 +03:00
5b7f62af55 Merge pull request #62910 from Vitika9/gsoc-colorpicker-ux
ColorPicker UX
2022-10-07 09:49:29 +02:00
544727ac1e Fix ColorPicker always emitting color_changed on html submit
The color change was always emitted when the the modal was closed, even if it was exactly the same as before.
2022-09-24 18:15:06 +02:00
b218727599 Rename raise() to move_to_front() 2022-09-06 22:13:06 +02:00
1dce43d417 ColorPicker UX improvements
- Tabs and MenuButton for mode selection and enabling/disabling colorized sliders
- MenuButton for shape selection with new icon for each shape
- Drag and drop functionality for presets to arrange order
- A chronological list of recently selected presets which are global for the editor
- Presets are now highlighted as being active or inactive
- Thicker sliders for easy targeting
- `grabber_offset` theme constant for Slider
- Uncolorized sliders
2022-09-06 21:42:20 +05:30