Commit graph

91 commits

Author SHA1 Message Date
Zi Ye
d827b34ea8 Fixed undo/redo behaviour of color picker and added ability to cancel/confirm color selection. 2024-03-24 15:12:11 -05:00
Hugo Locurcio
079f1c8ead
Display a revert icon on ColorPicker's old sample
This denotes that the color can be clicked to revert to the old color.
2023-11-07 10:04:39 +01:00
ajreckof
3160add2b0 Fix ColorPicker deferred mode not working for sliders. 2023-10-13 14:35:47 +02:00
Yuri Sizov
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
Yuri Sizov
2924bfd4d3 Register theme properties with ThemeDB 2023-09-11 13:45:23 +02:00
Rémi Verschelde
14256a2395
Merge pull request #78468 from KoBeWi/enmarginalization
Fix ColorPicker margin theme property
2023-08-08 16:55:32 +02:00
Hendrik Brucker
a29a680920 Extract StyleBoxFlat, StyleBoxTexture and StyleBoxLine in their own file 2023-07-17 13:25:00 +02:00
dinoplane
3f02b0cfde Moved HSV and OKHSL caching logic into color_mode 2023-07-05 07:15:58 -07:00
dinoplane
e11e9d2b9a Use cached saturation for color picker when value is 0 2023-06-21 15:18:20 -07:00
kobewi
9c3afcc898 Fix ColorPicker margin theme property 2023-06-20 12:47:52 +02:00
dinoplane
a374c7d519
Use cached hue for color picker when saturation is 0
Fixes #76968.
2023-06-12 10:59:33 +02:00
kobewi
b76ddeda45 Improve color picking 2023-05-19 14:21:43 +02:00
kobewi
14cb9b5b26 Add center_grabber property to Slider 2023-04-22 17:53:17 +02:00
Yuri Sizov
e401540264 Implement theme item cache in ColorPicker and friends 2023-04-03 18:01:11 +02:00
Markus Sauermann
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
Rémi Verschelde
906ee0b219
Merge pull request #67253 from KoBeWi/PICKER_USAGE_NO_EDITOR
Remove editor dependencies from ColorPicker
2023-01-21 20:52:16 +01:00
Rémi Verschelde
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
Rémi Verschelde
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
jbcolli2
c685c47f8a Fixed ColorPicker so the vertical option is not available in editor. 2022-11-04 13:59:25 -04:00
Chris Ridenour
286e7da162 Modularize the Color Picker via properties. 2022-11-04 00:08:46 -04:00
Haoyu Qiu
3aed3edc06 Allow selecting SpinBox & LineEdit text when focus enters 2022-10-29 09:58:42 +08:00
kobewi
a3661ad079 Remove editor dependencies from ColorPicker 2022-10-11 16:09:27 +02:00
Vitika9
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
Johan Aires Rastén
26ebea7286 Fix ColorPicker color and hsv sync issue
ColorPicker has both a Color and HSV values for the currently selected
color, fixed a few cases where those were not kept in sync.

Refactored a little regarding this, and removed a redundant update.

Solves #63777
2022-08-01 23:05:44 +02:00
Rémi Verschelde
90019676b0 Code quality: Fix header guards consistency
Adds `header_guards.sh` bash script, used in CI to validate future
changes. Can be run locally to fix invalid header guards.
2022-07-25 11:17:40 +02:00
Vitika9
0011d93c81 ColorPicker Refactor 2022-07-06 22:11:43 +05:30
K. S. Ernest (iFire) Lee
1b776a6e7a Allow picking similar colours using OKHSL. 2022-06-07 05:53:27 -07:00
Hugo Locurcio
a06f82ca4d
Add optional constructor arguments to more Control nodes
This can be used to make editor code more compact.
However, as of writing, these constructor arguments cannot be used
from the scripting API.

This was already provided for Label and CheckBox, but it was missing
for other Control nodes where it made sense to provide a default value.
2022-03-04 09:48:41 +01: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
Yuri Sizov
bdbb7b3999 Remove EDSCALE dependency from /scene/gui 2021-10-04 15:25:08 +03:00
Hendrik Brucker
ff9901f51e Reimplement ColorPicker presets 2021-08-18 02:09:48 +02:00
Francois Belair
94a464f555 Add cache to color picker for presets
This prevents loading from the project metadata more than once,
significantly saving performance with nodes that have color pickers.
2021-07-07 14:17:44 -04:00
Gregory Basile
8ab13f8ace Documentation search fixes
Updates rich_text_label so that the built-in documentation can be searched
Previously, it would only find the first result and would not select other results
Renames "_entered" functions to "_submitted"
2021-06-16 09:43:34 -07:00
kobewi
877dbda209 Create ColorPicker shaders statically 2021-05-17 11:39:20 +02:00
Hugo Locurcio
1e063595c3
Implement reverting to the old color when clicking it in ColorPicker 2021-05-10 18:13:33 +02:00
Hugo Locurcio
9e1bfe2e9e
Display the old color in ColorPicker for easier comparison
This only affects ColorPickerButton nodes that spawn a ColorPicker,
not standalone ColorPickers.

This partially addresses #7366.
2021-05-06 03:08:05 +02:00
Kongfa Waroros
6294507acb Add Various ColorPicker shapes 2021-04-06 22:48:03 +07:00
Kongfa Waroros
d295d53b4a Add interpolation bar on each channel in ColorPicker 2021-03-09 14:58:19 +07:00
Rafał Mikrut
7961a1dea3 Initialize class variables with default values in scene/ [2/2] 2021-02-09 18:24:36 +01:00
Rémi Verschelde
b5334d14f7
Update copyright statements to 2021
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 🎆
2021-01-01 20:19:21 +01:00
Marcel Admiraal
26fcf2b04c Add override keywords. 2020-07-10 13:56:54 +01:00
Hugo Locurcio
31b7f02a29
Remove ToolButton in favor of Button
ToolButton has no redeeming differences with Button;
it's just a Button with the Flat property enabled by default.
Removing it avoids some confusion when creating GUIs.

Existing ToolButtons will be converted to Buttons, but the Flat
property won't be enabled automatically.

This closes https://github.com/godotengine/godot-proposals/issues/1081.
2020-06-19 20:49:49 +02:00
Rémi Verschelde
0be6d925dc Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks
Which means that reduz' beloved style which we all became used to
will now be changed automatically to remove the first empty line.

This makes us lean closer to 1TBS (the one true brace style) instead
of hybridating it with some Allman-inspired spacing.

There's still the case of braces around single-statement blocks that
needs to be addressed (but clang-format can't help with that, but
clang-tidy may if we agree about it).

Part of #33027.
2020-05-14 16:54:55 +02:00
Juan Linietsky
3205a92ad8 PoolVector is gone, replaced by Vector
Typed `PoolTypeArray` types are now renamed `PackedTypeArray` and are
sugar for `Vector<Type>`.
2020-02-18 10:10:36 +01:00
Rémi Verschelde
a7f49ac9a1 Update copyright statements to 2020
Happy new year to the wonderful Godot community!

We're starting a new decade with a well-established, non-profit, free
and open source game engine, and tons of further improvements in the
pipeline from hundreds of contributors.

Godot will keep getting better, and we're looking forward to all the
games that the community will keep developing and releasing with it.
2020-01-01 11:16:22 +01:00
Tomás Antunes
606b56b5fb Increase color preset slots 2019-07-30 12:03:00 +01:00
Tomasz Chabora
9bdf110840 Fix set_pick_color error 2019-06-19 14:52:54 +02:00
Tomasz Chabora
86e4677fb4 Add HSV mode to color picker 2019-05-28 18:00:52 +02:00
will
eb9c92f996 ColorPicker: New properties to toggle the editability and visibility of presets 2019-02-24 23:16:56 -06:00
Rémi Verschelde
b16c309f82 Update copyright statements to 2019
Happy new year to the wonderful Godot community!
2019-01-01 12:58:10 +01:00