Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add editor setting for spin slider sensibility #50671

Merged

Conversation

winston-yallow
Copy link
Contributor

@winston-yallow winston-yallow commented Jul 20, 2021

This PR adds an editor setting "Float Drag Speed" to control the base speed of dragging EditorSpinSlider nodes. It is applied directly to grabbing_spinner_dist_cache which means that all the other logic (pressing shift to slow down; pressing control to snap to integers; and always being a multiple of step) works flawlessly with the new speed. The initial value for the setting is 5.0 to increase the base speed.

Closes godotengine/godot-proposals/issues/3017
Probably also makes godotengine/godot-proposals/issues/2760 obsolete. That proposal requests a key to increase the drag speed. With this PR it would instead have an increased base speed, using the existing shift modifier to slow the speed down if needed. This is in line with other applications like blender that use a similar approach.

@Calinou Calinou added cherrypick:3.x Considered for cherry-picking into a future 3.x release enhancement topic:editor usability labels Jul 20, 2021
@Calinou Calinou added this to the 4.0 milestone Jul 20, 2021
@Calinou
Copy link
Member

Calinou commented Jul 20, 2021

I think the setting should influence the speed of dragging both floating-point and integer values.

@winston-yallow
Copy link
Contributor Author

winston-yallow commented Jul 20, 2021

it does already influence the integer values, as those are calculated based on this floating point value
https://github.com/godotengine/godot/blob/5993060f49dd7e97e044deb87760d3b743ad00be/editor/editor_spin_slider.cpp#L127

@fire
Copy link
Member

fire commented Oct 9, 2021

Needs an update.

@winston-yallow winston-yallow force-pushed the improve-editor-spin-slider branch from 5993060 to 673fba4 Compare November 13, 2021 22:11
@winston-yallow
Copy link
Contributor Author

winston-yallow commented Nov 13, 2021

Rebased on current master and adjusted to use EDITOR_SETTING macro like all other settings in master. Therefore this cannot be easily cherry-picked for 3.x anymore. Should I make a second PR for 3.x once this is accepted?

Also I wasn't really able to test this in 4.x as dragging does not work for me (neither with or without this PR).

@akien-mga akien-mga modified the milestones: 4.0, 4.x Jan 19, 2023
@winston-yallow winston-yallow force-pushed the improve-editor-spin-slider branch from 673fba4 to c497df2 Compare April 26, 2023 19:06
@winston-yallow
Copy link
Contributor Author

Updated to work with current master. From my side this is ready now.

@winston-yallow winston-yallow force-pushed the improve-editor-spin-slider branch 2 times, most recently from 87cd326 to bccb383 Compare April 26, 2023 20:06
@winston-yallow winston-yallow requested a review from a team as a code owner April 26, 2023 20:06
@winston-yallow winston-yallow force-pushed the improve-editor-spin-slider branch 2 times, most recently from a6be24f to 81fda33 Compare April 26, 2023 20:34
@winston-yallow
Copy link
Contributor Author

And now the CI should be happy too 🤞

@winston-yallow winston-yallow force-pushed the improve-editor-spin-slider branch from 81fda33 to 19b41f7 Compare April 27, 2023 11:04
@akien-mga
Copy link
Member

It crashes when generating the documentation, instantiating EditorSpinSlider while probably EditorSettings doesn't exist as a singleton. From the CI logs:

 editor/gui/editor_spin_slider.cpp:709:63: runtime error: member access within null pointer of type 'struct EditorSettings'
core/object/object.cpp:311:6: runtime error: member access within null pointer of type 'const struct Object'

================================================================
handle_crash: Program crashed with signal 11
Engine version: Godot Engine v4.1.dev.custom_build (67caeac3de2cb07e1907fbac65cb4e99d19a8914)
Dumping the backtrace. Please include this when reporting the bug to the project developer.
[1] ./bin/godot.linuxbsd.editor.dev.double.x86_64.san(+0x3ae94384) [0x55b998cc9384] (??:?)
[2] /lib/x86_64-linux-gnu/libc.so.6(+0x43090) [0x7f91b19f2090] (??:0)
[3] Object::get(StringName const&, bool*) const (??:?)
[4] EditorSpinSlider::EditorSpinSlider() (??:?)
[5] Object* ClassDB::creator<EditorSpinSlider>() (??:?)
[6] ClassDB::instantiate(StringName const&) (??:?)
[7] ClassDB::class_get_default_property_value(StringName const&, StringName const&, bool*) (??:?)
[8] ./bin/godot.linuxbsd.editor.dev.double.x86_64.san(+0x44e43d37) [0x55b9a2c78d37] (??:?)
[9] DocTools::generate(bool) (??:?)
[10] EditorHelp::generate_doc(bool) (??:?)
[11] EditorNode::EditorNode() (??:?)
[12] Main::start() (??:?)
[13] ./bin/godot.linuxbsd.editor.dev.double.x86_64.san(main+0x3da) [0x55b998cc8a83] (??:?)
[14] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf3) [0x7f91b19d3083] (??:0)
[15] ./bin/godot.linuxbsd.editor.dev.double.x86_64.san(_start+0x2e) [0x55b998cc85ee] (??:?)
-- END OF BACKTRACE --
================================================================

@winston-yallow winston-yallow force-pushed the improve-editor-spin-slider branch 2 times, most recently from 9d9d59b to e54f4c3 Compare April 27, 2023 11:43
@winston-yallow winston-yallow force-pushed the improve-editor-spin-slider branch from e54f4c3 to 277e261 Compare April 27, 2023 11:45
@akien-mga akien-mga merged commit f43b39a into godotengine:master Apr 27, 2023
@akien-mga
Copy link
Member

Thanks!

@akien-mga akien-mga modified the milestones: 4.x, 4.1 Apr 27, 2023
@winston-yallow winston-yallow deleted the improve-editor-spin-slider branch November 4, 2023 20:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cherrypick:3.x Considered for cherry-picking into a future 3.x release enhancement topic:editor usability
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add an editor setting to adjust the property value dragging sensitivity in the inspector
4 participants