Cant change the size of spinBox node

4.2

Is there a way to change the size of the spinBox node ?
then min size is always x83.063 y31…

it depends on its parent node. Some nodes restrict setting the node size of their children. How does it look in the editor?

It doesnt have a parent…
You can make an empty scene make the 1st node a spinBox

I think the parent is in the spinBox node itself, its a child of lineEdit or vice Versa

That happens because the LineEdit minimum size is calculated using the LineEdit.minumum_character_width theme constant and the font assigned to it.

If you want to make it smaller you’ll need to add a Theme overriding that value or use an script like:

extends SpinBox


func _ready() -> void:
	var line_edit = get_line_edit()
	# Set the minumum character width of the line edit to 1
	line_edit.add_theme_constant_override("minimum_character_width", 1)
	# Resize the spin box to update the size
	size = Vector2.ZERO

Result:
image

thanks,
It only works in script ? Or can it be done in the editor ?

If you want to do it in the editor you’ll need to add a Theme and override that constant as said before.

theme override only takes the icon…
I think it only works on script

it worked thanks

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.