1
0
Fork 0
mirror of https://github.com/Orama-Interactive/Pixelorama.git synced 2025-01-18 17:19:50 +00:00

Allow disabling ValueSlider

Maybe we should make theme changes as well when it's disabled, but it's fine for now.
This commit is contained in:
Emmanouil Papadeas 2022-09-30 12:08:44 +03:00
parent fdfcd6ca1b
commit 5664271b27
3 changed files with 7 additions and 2 deletions

View file

@ -5,6 +5,7 @@ extends TextureProgress
enum { NORMAL, HELD, SLIDING, TYPING }
export var editable := true
export var prefix: String
export var suffix: String
# Size of additional snapping (applied in addition to Range's step).
@ -31,6 +32,8 @@ func _ready() -> void:
func _gui_input(event: InputEvent) -> void:
if not editable:
return
if state == NORMAL:
if event is InputEventMouseButton and event.button_index == BUTTON_LEFT and event.pressed:
state = HELD

View file

@ -15,6 +15,8 @@ size_flags_horizontal = 3
theme_type_variation = "ValueSlider"
texture_under = ExtResource( 2 )
texture_progress = ExtResource( 2 )
tint_under = Color( 0, 0, 0, 1 )
tint_progress = Color( 0, 0, 0, 1 )
nine_patch_stretch = true
stretch_margin_left = 3
stretch_margin_top = 3
@ -28,8 +30,10 @@ anchor_bottom = 1.0
mouse_filter = 2
custom_styles/read_only = SubResource( 1 )
custom_styles/normal = SubResource( 1 )
text = "0"
align = 1
editable = false
selecting_enabled = false
[connection signal="value_changed" from="." to="." method="_on_value_changed"]
[connection signal="focus_exited" from="LineEdit" to="." method="_confirm_text"]

View file

@ -780,8 +780,6 @@ rect_min_size = Vector2( 207, 24 )
size_flags_horizontal = 1
size_flags_vertical = 0
value = 100.0
tint_under = Color( 0, 0, 0, 1 )
tint_progress = Color( 0, 0, 0, 1 )
prefix = "Opacity:"
[node name="SpacerControl2" type="Control" parent="ScrollContainer/TimelineContainer/OpacityAndTagContainer"]